Jenkins powershell plugin always builds successfully

前端 未结 6 1653
攒了一身酷
攒了一身酷 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:38

    As of 1.3, the plugin will not handle exceptions such as those from missing commands. You can do this yourself with try/catch:

    try
    {
        asdf
    }
    catch
    {
        write-host "Caught an exception"
        exit 1
    }
    

    See MSDN for more.

提交回复
热议问题