Powershell实现捕获系统内置EXE程序的异常 | 您所在的位置:网站首页 › powershellexe › Powershell实现捕获系统内置EXE程序的异常 |
支持所有版本。 当你运行控制台EXE命令,如robocopy.exe, ipconfig.exe或类似命令。你可以用Powershell获得他们引起的错误: 代码如下: try { $current = $ErrorActionPreference $ErrorActionPreference = ‘Stop’ # this will cause an EXE command to emit an error # (replace with any console-based EXE command) net.exe user nonexistentU |
CopyRight 2018-2019 实验室设备网 版权所有 |