Why are my PowerShell exit codes always “0”?

前端 未结 5 1210
死守一世寂寞
死守一世寂寞 2020-12-04 14:59

I\'ve got a PowerShell script as follows

##teamcity[progressMessage \'Beginning build\']
# If the build computer is not running the appropriate version of .N         


        
5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-04 15:53

    Using -ErrorAction stop on a command returns an Exit code 1 by default and is showing it also in TeamCity without adding a Failure Condition. We will now implement this behaviour by default for every PowerShell command using $ErrorActionPreference = "Stop";.

提交回复
热议问题