是否可以创建一个捕获非Powershell cmdlet错误的try-catch?
示例错误:
iperf3: error - unable to connect to server: Connection timed out
我想捕获该错误,然后尝试使用其他服务器以实现冗余。
谢谢您的帮助。
您可以尝试构建自己的powershell函数并使用“ throw”引发错误,但是您必须在powershell函数中自行识别错误