How to clear $Error in PowerShell?
PowershellPowershell Problem Overview
Is there a way to clear the $Error variable that tracks errors in a PowerShell session?
If so, how do you do it?
I have tried:
$error.clear
In the PowerShell ISE on Windows 7 and the $Error array is still populated.
Powershell Solutions
Solution 1 - Powershell
It is a .NET method call so you need parens:
$error.clear()