Handling Errors in PowerShell with Try-Catch-Finally
Offered By: Trevor Sullivan via YouTube
Course Description
Overview
Explore error handling in PowerShell with this comprehensive 19-minute video tutorial. Learn the difference between terminating and non-terminating errors, and master the use of try..catch..finally statements for effective exception management. Discover how to leverage the $ErrorActionPreference variable to control cmdlet behavior during exceptions, and transform non-terminating errors into terminating ones. Dive into handling multiple error types using specific catch blocks, and understand the purpose of the finally statement. Gain insights into the $PSItem automatic variable for enhanced error handling. Follow along with practical examples and expert guidance to improve your PowerShell scripting skills and create more robust, error-resistant code.
Syllabus
Intro
Exploring Non-terminating Errors
Wrap Commands in Try..Catch
Force Errors to Become Terminating Errors
Handling Multiple Specific Error Types
PowerShell Finally Statement
The $PSItem Automatic Variable
Taught by
Trevor Sullivan
Related Courses
Designing a Technical SolutionMicrosoft via edX Building Applications with SAP Cloud Application Programming Model
SAP Learning COBOL Programming with VSCode
IBM via Coursera Learn to Code using C# on VS Code
Coursera Project Network via Coursera Introduction to Github and Visual Studio Code
Coursera Project Network via Coursera