Skip to content

Commit daa66cc

Browse files
anandgupta42claude
andcommitted
fix: [#958] splat installer test args as array to preserve param tokens
The child-session env-injection fix made the arch tests deterministic, but passing the script args as single-quoted literals in the call expression bound parameter NAMES as positional string values (`$Version` became "-Version", `-Help` never triggered). Splat the args as a child-side array (`@__args`) so `-Version` / `-Help` parse as parameter tokens, matching the old `-File @ScriptArgs` behavior. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
1 parent 4491ef4 commit daa66cc

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎test/windows/install.Tests.ps1‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,15 @@ BeforeAll {
4141
$preamble += "`$env:$k = '$vEsc'; "
4242
}
4343
}
44+
# Splat the args as a child-side ARRAY so tokens like -Version / -Help bind
45+
# as parameter names. Passing them as quoted literals in a call expression
46+
# would instead bind them positionally as string VALUES (e.g. $Version would
47+
# become "-Version"); array splatting preserves command-line param parsing.
4448
$parts = @()
4549
foreach ($a in $ScriptArgs) { $parts += "'" + $a.Replace($sq, $escSq) + "'" }
46-
$argLiterals = $parts -join " "
50+
$argArray = $parts -join ","
4751
$scriptEsc = $script:InstallScript.Replace($sq, $escSq)
48-
$command = "$preamble & '$scriptEsc' $argLiterals"
52+
$command = "$preamble `$__args = @($argArray); & '$scriptEsc' @__args"
4953
$output = & pwsh -NoProfile -Command $command 2>&1 | Out-String
5054
return @{ Code = $LASTEXITCODE; Output = $output }
5155
}

0 commit comments

Comments
 (0)