Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Windows PowerShell Scripting
  • Table Of Contents Toc
Mastering Windows PowerShell Scripting

Mastering Windows PowerShell Scripting

By : Brenton J.W. Blawat
4.4 (16)
close
close
Mastering Windows PowerShell Scripting

Mastering Windows PowerShell Scripting

4.4 (16)
By: Brenton J.W. Blawat

Overview of this book

If you are a system administrator who wants to become an expert in controlling and automating your Windows environment, then this book is for you. Prior knowledge of PowerShell's core elements and applications is required for this book.
Table of Contents (16 chapters)
close
close
15
Index

Error and exception handling – parameters


PowerShell offers several different options to achieve error and exception handling. The most popular method used to catch non-terminating errors is bypassing error and exception handling parameters while executing PowerShell cmdlets. If a cmdlet detects a non-terminating error during runtime, the PowerShell Common Language Runtime (CLR) has the ability to store the error information in variables. You can then call the error variable and execute other actions based on the contents of the $error variable.

The PowerShell parameters that handle error and exceptions are –WarningAction and –ErrorAction. When an issue occurs with your script, the PowerShell CLR will reference the –ErrorAction and –WarningAction arguments to determine what the next step for the script is.

There are five actions that are supported within PowerShell. The SilentlyContinue action will suppress the error and warning information, populate the error variables, and continue. The...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering Windows PowerShell Scripting
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon