0

Is it possible to create a try-catch that catches a non-Powershell cmdlet error?

Example Error:

iperf3: error - unable to connect to server: Connection timed out

I want to catch that error and then try a different server for redundancy.

Thank you for the assist.

  • No, it is not possible to do this with a standard shell command. May be possible with .NET processes, otherwise it's limited to cmdlets and .NET code invoked from within Powershell – arco444 Sep 15 '20 at 09:24

1 Answers1

0

you can try to build your own powershell function and throw an error with "throw " but you have to identify the error on your own within the powershell function

LosFla
  • 99
  • 6