-ErrorAction is a PowerShell common parameter for deciding how a command responds when an error occurs. Its alias is -ea, which is handy at the prompt but easy to miss in help. section 4.6.2
Choose the behavior that matches the task:
- Use -ErrorAction Stop when a failure should interrupt the current operation and allow Try/Catch handling. section 24.4
- Use -EA SilentlyContinue only for errors you have deliberately decided do not matter, such as deleting an already-missing file. section 24.2
- Continue processing while recording failures with -ErrorVariable, appending to existing data when necessary. section 24.4
Discover and use the alias
Inspect a command's parameter metadata to find the alias, then run `Get-Process -ea Stop`. Tab completion can reveal -ea after typing `Get-Process -e`, although help does not show that it equals -ErrorAction. section 4.6.2
Inspect the parameter metadata to discover aliases that ordinary command help does not display. section 4.6.2
Handle a remote connection failure
For several computers, use `-ErrorAction Stop` inside a `foreach` loop when each connection should be attempted independently, or capture failures with `-ErrorVariable`. Wrap stopping operations in Try/Catch so the Catch block can warn the user. section 24.4


