How do I fail build if anything gets written to stderr?

Our current build server fails a build if anything is written to stderr. I'd like to mimic the same behavior, since we have dozens and dozens of PowerShell scripts whose error handling was written with that behavior in mind.

1 answer

If you don't want to make changes to your existing PowerShell script, one idea is you can write a wrapper script and put that wrapper script into Bamboo Build Plan Task. Wrapper script will do 2 things:

Calling the actual PowerShell script and catch its stderr output;

Generate a non-zero exit code if it caught output in stderr.

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.