refactor(windows): ensure output redirection for Invoke-LxsSibling and Invoke-LxsScript

This commit is contained in:
2026-09-09 15:33:47 -04:00
parent 1df5cdb0bb
commit d27bf49c40
2 changed files with 9 additions and 3 deletions
+5 -2
View File
@@ -745,7 +745,10 @@ function Invoke-LxsSibling {
$local = Join-Path $SelfDirectory $name
if (Test-Path $local) {
$global:LASTEXITCODE = 0
& $local @Arguments
# Out-Host, not a bare call: anything the child writes to the success
# stream (native command output, for one) would otherwise be collected
# into this function's return value alongside the exit code.
& $local @Arguments | Out-Host
return $LASTEXITCODE
}
@@ -765,7 +768,7 @@ function Invoke-LxsSibling {
Write-LxsOk 'Payload acquired'
try {
$global:LASTEXITCODE = 0
& $temp @Arguments
& $temp @Arguments | Out-Host
return $LASTEXITCODE
} finally {
Remove-Item $temp -Force -ErrorAction SilentlyContinue