Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Otterscript: Usage of Success exit code or EXEC operation - clarifications
-
Hi, I tried to find it in the Forum and documentation but without success.
I have an Otterscript in Buildmaster which should perform different code depending on the success or not of an Exec (or PSExec) command.
How can I do it?
IS there any variable containing the exit code of the command, that I can test in an IF THEN ELSE?
Or does an exit code different than the Success exit code raise an exception and thus I need to put it in a TRY/CATH?
Thanks
-
Hi @fabio-xodo_3872 ,
This is not captured in an output variable, but you can control which exit code means success or failure:
Exec MyProcess.exe ( SuccessExitCode: "> 0" );
Another alternative is to write a PowerShell script that captures the output as a variable, if you need to do logic based on multiple codes.
We could always add support for capturing it as an output variable as well.
hope that helps,
Alana