# Error Records

say it: **“AIR-er REK-erdz”** **/ˈɛrər ˈrɛkərdz/**

The object describing an error; \`$Error\[0\]\` is the latest.

## What is **Error Records**?

An **error record** is the object PowerShell creates for each error, with the message, the command and where it happened. `$Error[0]` is the most recent.

```powershell
$Error[0].Exception.Message
$Error[0].InvocationInfo.ScriptLineNumber
```

Level: Freelancer · [More PowerShell terms at this level](https://www.ask-codey.com/glossary?category=powershell&level=4)

Updated: November 17, 2026

Source: https://www.ask-codey.com/glossary/error-records
