O'Reilly logo

Pro Windows PowerShell by Hristo Deshev

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

9.1. Handling Errors

Errors in PowerShell can be of two kinds: terminating and nonterminating. The first kind of is similar to the exception concept found in many programming languages. Those are errors that are triggered because the command interpreter has encountered an exceptional situation and cannot continue. Once we raise such an error, all further execution stops. Typical terminating errors are raised by script syntax errors, trying to call nonexistent commands, or something of a similar severity. User-raised errors resulting from the throw statement, which we will look into later in this chapter, are also terminating errors.

Nonterminating errors are less severe. Those are usually errors indicating that the current command cannot be ...

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