Hiding Terminating Errors
Occasionally, you may have noticed that cmdlets throw errors although you specified "SilentlyContinue" as -ErrorAction.
The -ErrorAction parameter can only hide non-terminating errors (errors that originally were handled by the cmdlet). Any error that was not handled by the cmdlet is called "terminating". These errors are typically security-related and never covered by -ErrorAction.
So if you are a non-Administrator, the following call will raise an exception even though -ErrorAction asked to suppress errors:
To suppress terminating errors, you must use an error handler:
Get-EventLog -LogName Security
ReTweet this Tip!