November 24, 2014 Leave a comment
Are you finding that your TeamCity Powershell scripts are always returning exit code zero (a success) no matter what happens? Even when an exception is thrown and you can see the error message in your build log?
I ran into this problem recently while moving some of my Powershell scripts into script files in source control. It turns out this is not an issue in TeamCity, but rather caused by a bug in Powershell itself. Never fear, there is a workaround!
Read more of this post