Error Reporting

Vikas Sukhija · Apress eBooks · 2021

For successful scripting, error reporting is a must-have. If there is an error, you want to report it to the admin or the owner of the process/automation. PowerShell has different ways to do error reporting. The most common way is the $error variable as it contains all the errors that have occurred in the session. Let’s look at some cheat code examples that you can utilize. You can log errors or send them via email.

Read the paper · More papers on PaperTik