Use PowerShell 5 compatible argument handling in scratch runner
This commit is contained in:
@@ -95,13 +95,11 @@ function Invoke-External {
|
|||||||
|
|
||||||
$startInfo = [System.Diagnostics.ProcessStartInfo]::new()
|
$startInfo = [System.Diagnostics.ProcessStartInfo]::new()
|
||||||
$startInfo.FileName = $startFilePath
|
$startInfo.FileName = $startFilePath
|
||||||
|
$startInfo.Arguments = (($startArgumentList | ForEach-Object { Format-ProcessArgument -Value ([string]$_) }) -join ' ')
|
||||||
$startInfo.WorkingDirectory = $WorkingDirectory
|
$startInfo.WorkingDirectory = $WorkingDirectory
|
||||||
$startInfo.UseShellExecute = $false
|
$startInfo.UseShellExecute = $false
|
||||||
$startInfo.RedirectStandardOutput = $true
|
$startInfo.RedirectStandardOutput = $true
|
||||||
$startInfo.RedirectStandardError = $true
|
$startInfo.RedirectStandardError = $true
|
||||||
foreach ($argument in $startArgumentList) {
|
|
||||||
[void]$startInfo.ArgumentList.Add([string]$argument)
|
|
||||||
}
|
|
||||||
|
|
||||||
$process = [System.Diagnostics.Process]::new()
|
$process = [System.Diagnostics.Process]::new()
|
||||||
$process.StartInfo = $startInfo
|
$process.StartInfo = $startInfo
|
||||||
|
|||||||
Reference in New Issue
Block a user