Fixes KeyFilePath parameter for Linux systems (#4529)

This commit is contained in:
Paul Higinbotham
2017-08-15 09:42:29 -07:00
committed by Aditya Patwardhan
parent b953ab126d
commit 6b8d86ff60
2 changed files with 35 additions and 1 deletions
@@ -2217,7 +2217,35 @@ namespace System.Management.Automation.Runspaces
{
var argvList = new List<string>();
argvList.Add(psi.FileName);
argvList.AddRange(psi.Arguments.Split(' '));
var argsToParse = psi.Arguments.Trim();
var argsLength = argsToParse.Length;
for (int i=0; i<argsLength; )
{
var iStart = i;
switch (argsToParse[i])
{
case '"':
// Special case for arguments within quotes
// Just return argument value within the quotes
while ((++i < argsLength) && argsToParse[i] != '"') { };
if (iStart < argsLength - 1)
{
iStart++;
}
break;
default:
// Common case for parsing arguments with space character delimiter
while ((++i < argsLength) && argsToParse[i] != ' ') { };
break;
}
argvList.Add(argsToParse.Substring(iStart, (i-iStart)));
while ((++i < argsLength) && argsToParse[i] == ' ') { };
}
return argvList.ToArray();
}
@@ -1461,6 +1461,12 @@ namespace System.Management.Automation.Remoting.Client
StartReaderThread(_stdOutReader);
}
internal override void CloseAsync()
{
base.CloseAsync();
CloseConnection();
}
#endregion
#region Private Methods