Run Script - Powershell last exit codes are not working as expected
Last Updated October 02, 2017
Some syntax in powershell scripts do not cause the script task to exit with the proper exit code.
Example: $Host.SetShouldExit(99) Causes the script to exit with error code 0 making it seem like everything in the script was successful
This was caused by the fix to another issue.
There are three solutions to this issue.
Use different syntax. For exmaple:
Contact support and request the fix for bug 4068150. They will help you download and apply this fix. Note that if any upgrades are done to this system that the fix will need to be reapplied and is only good for 8.0 not 8.1
Wait until 8.5 where this issue has been addressed.
Subscribing will provide email updates when this Article is updated. Login is required to Subscribe