V3.8.2 -continueonerror change question

* ContinueOnError was scoped to ignore non-zero exit codes. It now operates at the function level and will allow continuing if an unknown exception occurs.
  * To ignore specific exit codes, use the new IgnoreExitCodes parameter, using * to ignore all.
  * To stop the script if the process fails, use the ExitOnProcessFailure parameter.
* Execute-Process would fail if an exception occurred, even when ContinueOnError was specified. It now ignores exceptions as expected.

Can you please explain in more detail what the first item in the change log quoted above means?
I was leveraging Execute-Process with -continueonError $true and it still errored out using 3.8.2. I had to add the -ignoreexitcodes switch before it would operate properly so am curious on what the behavior should be?

Prior to this change: -ContinueOnError $true turns all non-zero exit codes into 0, function errors throw error anyway. -IgnoreExitCodes does the same thing but you have to list the codes.

After the change: -ContinueOnError does not affect exit codes at all. It handles function errors. For example, when the path you specify isnt found. $true would allow the script to continue. $false would make the scrit stop since it encountered an error.
-IgnoreExitCodes can still turn exit codes into 0, but now also supports * to ignore all exit codes.

1 Like