How to catch an exception thrown in another Powershell script ?

Posted by symbion on Stack Overflow See other posts from Stack Overflow or by symbion
Published on 2010-05-13T10:24:46Z Indexed on 2010/05/13 11:34 UTC
Read the original article Hit count: 252

Filed under:
|

Good morning,

I have a two Powershell scripts; main.ps1 and sub.ps1. main.ps1 calls sub.ps1. Sometimes sub.ps1 throws an exception. Is it possible to catch the exception thrown by sub.ps1 from main.ps1 ?

Regards,

© Stack Overflow or respective owner

Related posts about powershell-v2.0

Related posts about exception