O'Reilly logo

Learn PowerShell Scripting in a Month of Lunches by Don Jones and Jeffery Hicks

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 15. Dealing with errors

You have a lot of 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 how to capture, deal with, log, and otherwise handle errors the tool may encounter.

Note

PowerShell.org offers a free eBook, The Big Book of PowerShell Error Handling, which dives into this topic from a more technical reference perspective (https://powershell.org/ebooks). 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 situation: an error and an exception. Because most PowerShell commands are designed to deal with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required