Question: what is $error in powershell?
Answer: Errors in PowerShell Errors in PowerShell are stored in the automatic variable $error. You can see how many errors you've encountered in your session by using: $error.count. This is essentially an array of errors, to access the first value you can use: $error[0]