如何在powershell中更改作业的状态

时间:2018-03-12 19:52:35

标签: powershell

我正在创建一个处理多个作业的脚本。控制作业的脚本根据其状态对作业执行不同的操作。

例如,如果我调用 Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 80 Job80 BackgroundJob Completed True localhost ... 82 Job82 BackgroundJob Completed True localhost ... 84 Job84 BackgroundJob Completed True localhost ... 86 Job86 BackgroundJob Completed True localhost ... 88 Job88 BackgroundJob Completed True localhost ... 90 Job90 BackgroundJob Completed True localhost ... 命令,我会得到这个......

{{1}}

如何使作业在发生特定错误时返回状态"失败"?

1 个答案:

答案 0 :(得分:0)

我必须在slave脚本中放置一个throw语句