# Errors

Errors: Reading Errors, and \`-ErrorAction\`, \`try\`, \`catch\` and \`finally\`.

Updated: November 10, 2026

1. [Reading Errors, and \`-ErrorAction\`](https://www.ask-codey.com/lessons/powershell-errors) (Apprentice): PowerShell's red text names the command that failed, what went wrong and, in a script, the file and line; some errors stop a command and some let it carry on, -ErrorAction decides what happens next, and $Error keeps a list of them.
2. [\`try\`, \`catch\` and \`finally\`](https://www.ask-codey.com/lessons/powershell-try-catch) (Journeyman): try runs your lines, catch runs only if one of them hits an error that stops it (which -ErrorAction Stop arranges), $\_ in catch is the error, so you can tell the user what happened and what to do, and finally runs whatever happens.

Source: https://www.ask-codey.com/courses/powershell-in-depth/topics/powershell-errors
