How do I get errors to propagate in the TeamCity PowerShell runner

后端 未结 10 2208
轻奢々
轻奢々 2020-12-05 23:47

I have a TeamCity 7 Build Configuration which is pretty much only an invocation of a .ps1 script using various TeamCity Parameters.

I was hoping that mig

10条回答
  •  悲哀的现实
    2020-12-06 00:15

    This checks the last error code and exits if is not 0.

        If ($LASTEXITCODE -ne 0) {
            Write-Host "The result was of the previous script was " $LASTEXITCODE
            Exit $LASTEXITCODE
        }
    

提交回复
热议问题