Like many other aspects of PowerShell, -ErrorAction kind of explains itself when you think of it. Basically it instructs PowerShell what action to take when an error occurs. The actions you can set are Continue (which is default), Stop, SilentlyContinue and Inquire. Let’s take a look.
You can verify that Continue is the default action by looking at the $ErrorActionPreference variable. We’ll be using the Stop-Process Cmdlet to test this.
Since we know continue is the default error action we don’t need to use “-ErrorAction Continue”.
The Stop error action instructs PowerShell to stop executing after the first error.
Compared to when we used “Continue”, PowerShell will only try to stop the process with id 206 and never move on to 304 since it failed to stop the first one.
As you might guess SilentlyContinue acts like Continue with the exception that we don’t see the errors. To save some typing we don’t need to write out ErrorAction, we can use EA for short.
Inquire informs us that there has been an error and lets us decide what to do.