15 Errors and how to deal with them
You have much functionality yet to write in the tool you’ve been building, and we’ve been deferring a lot of it to this point. In this chapter, we’ll focus on capturing, dealing with, logging, and otherwise handling errors the tool may encounter.
Note PowerShell.org offers a free e-book, The Big Book of PowerShell Error Handling, which dives into this topic from a more technical reference perspective (https://PowerShell.org/free-resources/). We recommend checking it out once you’ve completed this tutorial-focused chapter.
15.1 Understanding errors and exceptions
PowerShell defines two broad types of bad situations: errors and exceptions. Because most PowerShell commands are designed to deal with multiple things ...
Get Learn PowerShell Scripting in a Month of Lunches, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.