O'Reilly logo

Mastering Windows PowerShell Scripting by Brenton J.W. Blawat

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 6. Error and Exception Handling and Testing Code

One of the most important components for creating PowerShell scripts is error and exception handling. Error and exception handling is often a forgotten component of scripting because it's common to feel that the code should always execute linearly and in an implicit fashion. While small scripts may provide low risk opportunities to not use error and exception handling, it is still recommended to use some level of error and exception handling. This is due to the common practice of taking the small scripts and using them as starting points for more complex scripts. The more complex you build your scripts, the higher the probability of failure and unexpected results.

In this chapter, you will ...

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