From 7e7fbff30a427b70e709d975d706ada02680aeb9 Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Thu, 20 Feb 2020 12:38:38 -0800 Subject: [PATCH 1/2] Fix SSH remoting regression on Windows platform --- .../engine/remoting/common/RunspaceConnectionInfo.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs index f7312183c71..fd72d099c04 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs @@ -2548,7 +2548,12 @@ private static Process CreateProcessWithRedirectedStd( try { - var cmdLine = string.Format(CultureInfo.InvariantCulture, @"""{0}"" {1}", startInfo.FileName, startInfo.Arguments); + // Create process start command line with filename and argument list. + var cmdLine = string.Format( + CultureInfo.InvariantCulture, + @"""{0}"" {1}", + startInfo.FileName, + String.Join(' ', startInfo.ArgumentList)); lpStartupInfo.hStdInput = new SafeFileHandle(stdInPipeClient.DangerousGetHandle(), false); lpStartupInfo.hStdOutput = new SafeFileHandle(stdOutPipeClient.DangerousGetHandle(), false); From 1dba48f110d64c1a290673a1e5544bc13e03d3fb Mon Sep 17 00:00:00 2001 From: Paul Higinbotham Date: Thu, 20 Feb 2020 12:51:44 -0800 Subject: [PATCH 2/2] Fix CodeFactor issue --- .../engine/remoting/common/RunspaceConnectionInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs index fd72d099c04..937fa7dfab0 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs @@ -2553,7 +2553,7 @@ private static Process CreateProcessWithRedirectedStd( CultureInfo.InvariantCulture, @"""{0}"" {1}", startInfo.FileName, - String.Join(' ', startInfo.ArgumentList)); + string.Join(' ', startInfo.ArgumentList)); lpStartupInfo.hStdInput = new SafeFileHandle(stdInPipeClient.DangerousGetHandle(), false); lpStartupInfo.hStdOutput = new SafeFileHandle(stdOutPipeClient.DangerousGetHandle(), false);