$ErrorActionPreference = 'Stop'
Try{ # C:xxx 不存在 Copy-Item C:xxx -ErrorAction Stop } Catch{ Write-Host 'got you' exit 1 } Write-Host 'hello world'
作者:POPMUISE
链接:https://www.imooc.com/article/26333
来源:慕课网
$ErrorActionPreference = 'Stop'
Try{ # C:xxx 不存在 Copy-Item C:xxx -ErrorAction Stop } Catch{ Write-Host 'got you' exit 1 } Write-Host 'hello world'
作者:POPMUISE
链接:https://www.imooc.com/article/26333
来源:慕课网