Powershell fails to return proper exit code

后端 未结 1 842
天命终不由人
天命终不由人 2021-02-19 15:02

When executing a Powershell script (in 2.0) using the -File command line switch, and explicitly defining the input parameters in Param, the exit code is always

1条回答
  •  时光取名叫无心
    2021-02-19 15:14

    Hmm that's odd, I'd expect exit 1 to work in both cases. At least you can use this for both:

    [Environment]::Exit(1)

    0 讨论(0)
提交回复
热议问题