Fix command failure not resulting in task failure

For whatever reason (I don't understand this stuff well) the
`win-podman-machine-main.ps1` script exits successfully despite the
final `Check-Exit` showing a non-zero exit code was detected.  Attempt
to fix this by throwing an exception instead of calling `Exit`.

Signed-off-by: Chris Evich <cevich@redhat.com>
This commit is contained in:
Chris Evich
2023-11-30 15:01:44 -05:00
parent cbb3e4d20f
commit b7a81c1ce1

View File

@ -51,7 +51,7 @@ function Check-Exit {
# https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.callstackframe
$caller = (Get-PSCallStack)[1]
Write-Host "Exit code = '$result' from $($caller.ScriptName):$($caller.ScriptLineNumber)"
Exit $result
Throw "Non-zero exit code"
}
}