-ErrorAction
-ErrorAction is a PowerShell common parameter that controls how a command or function responds to nonterminating errors.
Practical Automation with PowerShell: Effective scripting from the console to the cloud
ErrorAction is a PowerShell common parameter that specifies how a command responds to non-terminating errors.
- How it is used
- Directs command failures into structured handling for resilient PowerShell automation and logging.
- How deep it goes
- Explains Stop and SilentlyContinue through service and action-script workflows, deferring broader logging treatment.
- Examples
- Uses missing-service lookups and file-moving action scripts with logging to demonstrate error responses.
- What you can do after
- Apply it via PowerShell commands to route expected and unexpected failures through appropriate handling paths.
Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS
-ea is a PowerShell parameter alias for -ErrorAction.
- How it is used
- Guides command-level decisions about continuing, stopping, suppressing, or recording PowerShell errors.
- How deep it goes
- Explains alias discovery, suppression risks, remote-processing choices, ErrorVariable, and Try/Catch, but not parameter implementation internals.
- Examples
- Uses Get-Process, Remove-Item, remote PSSession creation, service-state checks, and a remote uptime function.
- What you can do after
- Apply it via PowerShell commands to choose deliberate error behavior and build logging or Try/Catch handling.
Learn PowerShell Scripting in a Month of Lunches, Second Edition: Write and organize scripts and tools
ErrorAction is a PowerShell common parameter that controls how a command or function responds to errors.
- How it is used
- Controls per-command responses to nonterminating errors during PowerShell automation.
- How deep it goes
- Defines five practical response choices and recommends command-level control, while warning against indiscriminate suppression.
- Examples
- Uses missing-service lookups, Remove-Item suppression, and a DNS wrapper that catches .NET exceptions.
- What you can do after
- Apply it per command to continue, suppress, prompt, ignore, or catch selected failures.
Related concepts
- Remove-Itemconfigures · Remove-Item is a PowerShell cmdlet that deletes specified files, directories, and other provider items, including their contents when applicable.
- try-catch statementconfigures · A try-catch statement is a control-flow construct that executes code under exception handling and transfers control to a matching handler when an exception is raised.
- aliaskind of · An alias is an alternative name by which an entity, command, parameter, or resource can be referred to.
- CmdletBinding attributeconfigured by · The CmdletBinding attribute is a PowerShell declaration that enables cmdlet-like behavior and advanced features for a script or function.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


