How Can We Help?
< Back
You are here:
Print

Use Try-Catch

Avoid testing for the successful completion of a call to a cmdlet with an If-Then-Else construct. Rather use a Try-Catch construct (whenever possible).

Don’t do

But rather do

 

Previous Try-Catch and $_

Leave a Reply

Your email address will not be published.

*
*

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Table of Contents