Skip to content

Commit a1c3c06

Browse files
Refine escalation terminology: terminating (context-dependent) not script-terminating
Per mklement0 feedback, -ErrorAction Stop escalation scope depends on whether the context is advanced ([CmdletBinding()]) or non-advanced. Changed about_CommonParameters.md and ErrorAction table to say "terminating error" generically, with escalation section providing the full advanced vs. non-advanced explanation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bc5e604 commit a1c3c06

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

reference/7.6/Microsoft.PowerShell.Core/About/about_CommonParameters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ catchable by `try/catch`. For more information about error categories, see
144144
- `SilentlyContinue` suppresses the error message and continues executing the
145145
command.
146146
- `Stop` displays the error message and stops executing the command. The
147-
`Stop` value escalates the non-terminating error to a script-terminating
148-
error by generating an `ActionPreferenceStopException`. The error can then
147+
`Stop` value escalates the non-terminating error to a terminating error
148+
by generating an `ActionPreferenceStopException`. The error can then
149149
be caught by a `try/catch` block or `trap` statement.
150150
- `Suspend` is only available for workflows which aren't supported in
151151
PowerShell 6 and beyond.

reference/7.6/Microsoft.PowerShell.Core/About/about_Error_Handling.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ error at index `0`. The list holds up to `$MaximumErrorCount` entries (default
172172
256).
173173

174174
All non-terminating and terminating errors are added to `$Error` unless
175-
`-ErrorAction Ignore` is used, which prevents both display and recording.
175+
`-ErrorAction Ignore` is used on non-terminating errors, which prevents both
176+
display and recording. For terminating errors, `Ignore` suppresses display but
177+
still records the error in `$Error`.
176178

177179
### $LASTEXITCODE
178180

@@ -193,7 +195,7 @@ errors from that command.
193195
| `Continue` | Display the error and continue (default) |
194196
| `SilentlyContinue` | Suppress display, add to `$Error`, continue |
195197
| `Ignore` | Suppress display and do not add to `$Error` |
196-
| `Stop` | **Escalate** to a script-terminating error |
198+
| `Stop` | **Escalate** to a terminating error (see [How escalation works][05]) |
197199
| `Inquire` | Prompt the user for a decision |
198200
| `Break` | Enter the debugger |
199201

@@ -208,7 +210,7 @@ current scope and child scopes. It accepts the same values as `-ErrorAction`.
208210

209211
```powershell
210212
$ErrorActionPreference = 'Stop'
211-
# All non-terminating errors in this scope now become script-terminating
213+
# All non-terminating errors in this scope now become terminating
212214
Write-Error 'This now throws' # Generates ActionPreferenceStopException
213215
```
214216

@@ -260,7 +262,7 @@ try {
260262
}
261263
262264
try {
263-
# With -ErrorAction Stop: escalated to script-terminating
265+
# With -ErrorAction Stop: escalated to terminating
264266
Write-Error 'This becomes terminating' -ErrorAction Stop
265267
} catch {
266268
Write-Output "Caught: $_" # Reached

0 commit comments

Comments
 (0)