Reputation: 459
I am using a powershell script to perform a few tasks that are pre requisites for my MsBuild. The script is called from the build itself. How do i check if the script succeeded so that my build can continue, else fail.
Upvotes: 0
Views: 204
Reputation: 72171
The easiest way would be to return a non exit zero code from your script that would indicate that the build failed. So something like this at the end of the script:
if ($error) { exit 1 }
that would exit with a code of 1 if any errors occured during the script
Upvotes: 1