powershell PowerShell错误处理

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了powershell PowerShell错误处理相关的知识,希望对你有一定的参考价值。

# suppress errors by default 
$ErrorActionPreference = 'SilentlyContinue'
# if a command runs into an error... 
Get-Process -Name zumsel
# ...then $? is $false, and you can exit PowerShell 
# with a return value, i.e. 55 
if (!$?) { exit 55 }

以上是关于powershell PowerShell错误处理的主要内容,如果未能解决你的问题,请参考以下文章