Jenkins powershell plugin always builds successfully

前端 未结 6 1714
攒了一身酷
攒了一身酷 2021-02-04 00:46

I\'m using Jenkins PowerShell plugin to build a project.

However, I found that Jenkins always considers my build successful no matter what I type inside Windows P

6条回答
  •  無奈伤痛
    2021-02-04 01:51

    For me, I wanted the script to stop and fail in Jenkins soon as it hit an error. This was accomplished by adding this to the start of the script:

    $ErrorActionPreference = "Stop"

    This is discussed here: How to stop a PowerShell script on the first error?

提交回复
热议问题