Skip to Main Content
Learn PowerShell Scripting in a Month of Lunches, Second Edition
book

Learn PowerShell Scripting in a Month of Lunches, Second Edition

by James Petty, Jeffery Hicks, Don Jones
April 2024
Beginner to intermediate content levelBeginner to intermediate
336 pages
8h 51m
English
Manning Publications
Content preview from Learn PowerShell Scripting in a Month of Lunches, Second Edition

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 ...

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.
Start your free trial

You might also like

Learn PowerShell Scripting in a Month of Lunches

Learn PowerShell Scripting in a Month of Lunches

Jeffery Hicks, Don Jones
Learn PowerShell in a Month of Lunches, Fourth Edition

Learn PowerShell in a Month of Lunches, Fourth Edition

Tyler Leonhardt, Travis Plunk, James Petty

Publisher Resources

ISBN: 9781633438989Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link