Chapter 14. Handling errors

When it comes to handling errors in your script, you need to have an understanding of the intended use of the script. The way that a script will be used is sometimes called the use case scenario. It describes how the user will interact with the script. If the use case scenario is simple, the user might not need to do anything more than type the name of the script inside the Windows PowerShell console. A script such as Get-Bios.ps1 could get by without much need for any error handling. This is because there are no inputs to the script. The script is called, it runs, and it displays information that should always be readily available ...

Get Windows PowerShell 3.0 First Steps 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.