mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fixes KeyFilePath parameter for Linux systems (#4529)
This commit is contained in:
committed by
Aditya Patwardhan
parent
b953ab126d
commit
6b8d86ff60
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user