refactor(windows): ensure output redirection for Invoke-LxsSibling and Invoke-LxsScript
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user