From 5d594461140ba4ac5320e8044d1236b2b5380617 Mon Sep 17 00:00:00 2001 From: Simone Date: Sat, 23 May 2026 22:39:32 +0200 Subject: [PATCH] fix(burn-in): use pwsh instead of powershell.exe on Linux host MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit powershell.exe does not exist on Linux — child process launch failed instantly (ExitCode null, Elapsed 00:00). Now selects powershell.exe on Windows and pwsh on Linux via $IsWindows automatic variable. Co-Authored-By: Claude Sonnet 4.6 --- scripts/Test-CapacityBurnIn.ps1 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/Test-CapacityBurnIn.ps1 b/scripts/Test-CapacityBurnIn.ps1 index eeebac1..1113ec3 100644 --- a/scripts/Test-CapacityBurnIn.ps1 +++ b/scripts/Test-CapacityBurnIn.ps1 @@ -214,19 +214,20 @@ for ($r = 1; $r -le $Rounds; $r++) { $argArray = $argList.ToArray() - # Start-Job runs a new PS session; call powershell.exe as child process - # so exit $exitCode from Invoke-CIJob.ps1 is captured in $LASTEXITCODE. + # Start-Job runs a new PS session; call the platform PS executable as child + # process so exit $exitCode from Invoke-CIJob.ps1 is captured in $LASTEXITCODE. # NOTE: do NOT name the parameter $Args — @Args is a PS reserved splatting # alias for the automatic $Args variable (unbound arguments), which would # be empty here since the parameter binding consumed all positional args. + $psExe = if ($IsWindows) { 'powershell.exe' } else { 'pwsh' } $psJob = Start-Job -ScriptBlock { - param([string[]]$ChildArgs) - $out = & powershell.exe @ChildArgs 2>&1 + param([string[]]$ChildArgs, [string]$PsExe) + $out = & $PsExe @ChildArgs 2>&1 [PSCustomObject]@{ ExitCode = $LASTEXITCODE Output = ($out -join "`n") } - } -ArgumentList (, $argArray) + } -ArgumentList (, $argArray), $psExe $jobEntries.Add(@{ PSJob = $psJob