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.

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

Level: Freelancer · More PowerShell terms at this level

Updated