Skip to content

Use SetShouldExit to reliably exit with a non-zero

What does this MR do?

It reliably exits the PowerShell process with the captured exit code.

Why was this MR needed?

PowerShell isn't passing the exit code all the way through. Setting $host.SetShouldExit() within the job works reliably.

What's the best way to test this MR?

A simple non-zero exit without this merge should be successful:

Exit 1

With this merge, I'm expecting that the exit code be passed all the way through causing the expected result.

What are the relevant issue numbers?

Edited by Raymond Piller

Merge request reports