- Notifications
You must be signed in to change notification settings - Fork544
Only update the session ExitCode inStart-ADTProcess if it's not already set.#1861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Example given in the issue is now resolved. But I think we could do with some more advanced logic here. Rather than:
"only update the exit code if it is currently 0"
Perhaps it should be:
"only update the exit code if the current exit code is a success code"
Basically, if you run a series of installs, we always want a reboot code to trump a success code, and an error code to trump both.
$adtSession=Open-ADTSession-PassThruStart-ADTProcess-FilePath C:\Windows\System32\cmd.exe-ArgumentList'/c exit 1'-SuccessExitCodes1Start-ADTProcess-FilePath C:\Windows\System32\cmd.exe-ArgumentList'/c exit 3010'$adtSession.GetExitCode()
Exit code is still 1 with the example above, when I would like to see 3010.
Fixes#1848.