Use PowerShell 5 compatible argument handling in scratch runner

This commit is contained in:
master
2026-03-13 13:55:30 +02:00
parent 7c955dce3a
commit 024b162b55

View File

@@ -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