PowerShell: Automating Administrative Tasks
by Michael Shepard, Chendrayan Venkatesan, Sherif Talaat, Brenton J.W. Blawat
Summary
This chapter displays how to properly incorporate error and exception handling in your scripts. You explored how to leverage built-in cmdlet parameters for error and exception handling, and how to work with warnings and errors in your scripts. You also learned the Try/Catch block and how to use that to catch errors outside of what cmdlets can handle. You also learned how to use the cmdlet parameter for error and exception handling in conjunction with the Try/Catch block to provide robust solutions for catching issues in your scripts.
This chapter also explored methods with which you can work with legacy command-line tools and catch error messages from these tools. You learned that while the legacy tools may not have robust exception handling, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access