Rundeck 4.8.0 community version on Redhat 9 Linux with Windows node. My Rundeck jobs call powershell (.ps1) scripts on the windows node as a command. For example :
Command : E:\\Scripts\\test.ps1 -name ${option.name} -address ${option.address}
If there are any errors encountered in the script, the Rundeck job dies. The rundeck output gives the NonZeroResultCode message
NonZeroResultCode: [WinRMPython] Result code: 1
There’s more code that needs to be run after where the error occurred, but Rundeck just dies and doesn’t continue the rest of the .ps1.
I previously used Rundeck version 3.something, I thing it was 3.9.
If there was an error in the script, such as a get or a set failed, the Rundeck console would just display the text of the error in red, and continue.
Now I know I can change my code and add try/catch statements, -erroraction SilentlyContinue and so on. However it makes no sense to me that Rundeck takes it upon itself to kill my script because a get or a set failed.
I want to be the one to decide if I want to exit the script or not, I don’t want Rundeck to make that decision.
Can this behavior be changed?
There is the error handling feature, I read the docs, but I cannot figure out how to use that with an error inside the powershell script.
/ERROR ] Execution finished with the following error (winrm-exec.py:323)yroot]
bERROR ] Performing the operation “New” on target … blah blah blah … etc
Failed: NonZeroResultCode: rWinRMPython] Result code: 1
thanks in advance