Skip to content

Commit 726b28f

Browse files
authored
Fix description of PSNativeCommandErrorActionPreference behavior (#12552)
1 parent e5c23d2 commit 726b28f

File tree

5 files changed

+49
-43
lines changed

5 files changed

+49
-43
lines changed

reference/5.1/Microsoft.PowerShell.Core/About/about_Preference_Variables.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Variables that customize the behavior of PowerShell.
33
Locale: en-US
4-
ms.date: 06/17/2024
4+
ms.date: 12/01/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-5.1&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Preference_Variables
@@ -19,8 +19,8 @@ behavior. These preference variables work like the options in GUI-based
1919
systems.
2020

2121
The preference variables affect the PowerShell operating environment and all
22-
commands run in the environment. In many cases, the cmdlets have parameters
23-
that you can use to override the preference behavior for a specific command.
22+
commands run in the environment. Some cmdlets have parameters that allow you to
23+
override the preference behavior for a specific command.
2424

2525
The following table lists the preference variables and their default values.
2626

reference/7.4/Microsoft.PowerShell.Core/About/about_Preference_Variables.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Variables that customize the behavior of PowerShell.
33
Locale: en-US
4-
ms.date: 04/06/2024
4+
ms.date: 12/01/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-7.4&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Preference_Variables
@@ -119,7 +119,8 @@ Cmdlets and functions are assigned a risk of **High**, **Medium**, or **Low**.
119119
When the value of the `$ConfirmPreference` variable is less than or equal to
120120
the risk assigned to a cmdlet or function, PowerShell automatically prompts you
121121
for confirmation before running the cmdlet or function. For more information
122-
about assigning a risk to cmdlets or functions, see [about_Functions_CmdletBindingAttribute][66].
122+
about assigning a risk to cmdlets or functions, see
123+
[about_Functions_CmdletBindingAttribute][66].
123124

124125
If the value of the `$ConfirmPreference` variable is **None**, PowerShell never
125126
automatically prompts you before running a cmdlet or function.
@@ -167,11 +168,12 @@ Cmdlets and functions that might pose a risk to the system have a **Confirm**
167168
parameter that you can use to request or suppress confirmation for a single
168169
command.
169170

170-
Most cmdlets and functions keep the default value of **Medium** for **ConfirmImpact**.
171-
`$ConfirmPreference` is set to **High** by default. Therefore, it's rare that commands
172-
automatically prompt for confirmation when users don't specify the **Confirm** parameter.
173-
To extend automatic confirmation prompting to more cmdlets and functions, set the value
174-
of `$ConfirmPreference` to **Medium** or **Low**.
171+
Most cmdlets and functions keep the default value of **Medium** for
172+
**ConfirmImpact**. `$ConfirmPreference` is set to **High** by default.
173+
Therefore, it's rare that commands automatically prompt for confirmation when
174+
users don't specify the **Confirm** parameter. To extend automatic confirmation
175+
prompting to more cmdlets and functions, set the value of `$ConfirmPreference`
176+
to **Medium** or **Low**.
175177

176178
### Examples
177179

reference/7.5/Microsoft.PowerShell.Core/About/about_Preference_Variables.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Variables that customize the behavior of PowerShell.
33
Locale: en-US
4-
ms.date: 04/06/2024
4+
ms.date: 12/01/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-7.5&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Preference_Variables
@@ -119,7 +119,8 @@ Cmdlets and functions are assigned a risk of **High**, **Medium**, or **Low**.
119119
When the value of the `$ConfirmPreference` variable is less than or equal to
120120
the risk assigned to a cmdlet or function, PowerShell automatically prompts you
121121
for confirmation before running the cmdlet or function. For more information
122-
about assigning a risk to cmdlets or functions, see [about_Functions_CmdletBindingAttribute][66].
122+
about assigning a risk to cmdlets or functions, see
123+
[about_Functions_CmdletBindingAttribute][66].
123124

124125
If the value of the `$ConfirmPreference` variable is **None**, PowerShell never
125126
automatically prompts you before running a cmdlet or function.
@@ -167,11 +168,12 @@ Cmdlets and functions that might pose a risk to the system have a **Confirm**
167168
parameter that you can use to request or suppress confirmation for a single
168169
command.
169170

170-
Most cmdlets and functions keep the default value of **Medium** for **ConfirmImpact**.
171-
`$ConfirmPreference` is set to **High** by default. Therefore, it's rare that commands
172-
automatically prompt for confirmation when users don't specify the **Confirm** parameter.
173-
To extend automatic confirmation prompting to more cmdlets and functions, set the value
174-
of `$ConfirmPreference` to **Medium** or **Low**.
171+
Most cmdlets and functions keep the default value of **Medium** for
172+
**ConfirmImpact**. `$ConfirmPreference` is set to **High** by default.
173+
Therefore, it's rare that commands automatically prompt for confirmation when
174+
users don't specify the **Confirm** parameter. To extend automatic confirmation
175+
prompting to more cmdlets and functions, set the value of `$ConfirmPreference`
176+
to **Medium** or **Low**.
175177

176178
### Examples
177179

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Variables that customize the behavior of PowerShell.
33
Locale: en-US
4-
ms.date: 04/06/2024
4+
ms.date: 12/01/2025
55
online version: https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-7.6&WT.mc_id=ps-gethelp
66
schema: 2.0.0
77
title: about_Preference_Variables
@@ -119,7 +119,8 @@ Cmdlets and functions are assigned a risk of **High**, **Medium**, or **Low**.
119119
When the value of the `$ConfirmPreference` variable is less than or equal to
120120
the risk assigned to a cmdlet or function, PowerShell automatically prompts you
121121
for confirmation before running the cmdlet or function. For more information
122-
about assigning a risk to cmdlets or functions, see [about_Functions_CmdletBindingAttribute][66].
122+
about assigning a risk to cmdlets or functions, see
123+
[about_Functions_CmdletBindingAttribute][66].
123124

124125
If the value of the `$ConfirmPreference` variable is **None**, PowerShell never
125126
automatically prompts you before running a cmdlet or function.
@@ -167,11 +168,12 @@ Cmdlets and functions that might pose a risk to the system have a **Confirm**
167168
parameter that you can use to request or suppress confirmation for a single
168169
command.
169170

170-
Most cmdlets and functions keep the default value of **Medium** for **ConfirmImpact**.
171-
`$ConfirmPreference` is set to **High** by default. Therefore, it's rare that commands
172-
automatically prompt for confirmation when users don't specify the **Confirm** parameter.
173-
To extend automatic confirmation prompting to more cmdlets and functions, set the value
174-
of `$ConfirmPreference` to **Medium** or **Low**.
171+
Most cmdlets and functions keep the default value of **Medium** for
172+
**ConfirmImpact**. `$ConfirmPreference` is set to **High** by default.
173+
Therefore, it's rare that commands automatically prompt for confirmation when
174+
users don't specify the **Confirm** parameter. To extend automatic confirmation
175+
prompting to more cmdlets and functions, set the value of `$ConfirmPreference`
176+
to **Medium** or **Low**.
175177

176178
### Examples
177179

reference/docs-conceptual/learn/shell/running-commands.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: >
33
This article shows how to run commands in PowerShell.
44
title: Running commands in the shell
5-
ms.date: 11/21/2025
5+
ms.date: 12/01/2025
66
---
77
# Running commands in the shell
88

@@ -70,17 +70,17 @@ adjust how you pass those strings.
7070

7171
For more information, see the following articles:
7272

73-
- [about_Parsing][1]
74-
- [about_Quoting_Rules][2]
73+
- [about_Parsing][03]
74+
- [about_Quoting_Rules][06]
7575

7676
PowerShell 7.2 introduced a new experimental feature `PSNativeCommandArgumentPassing` that improved
77-
native command handling. For more information, see [`$PSNativeCommandArgumentPassing`][3].
77+
native command handling. For more information, see [`$PSNativeCommandArgumentPassing`][04].
7878

7979
### Handling output and errors
8080

8181
PowerShell also has several more output streams than other shells. The `bash` and `cmd.exe` shells
8282
have **stdout** and **stderr**. PowerShell has six output streams. For more information, see
83-
[about_Redirection][4] and [about_Output_Streams][5].
83+
[about_Redirection][07] and [about_Output_Streams][02].
8484

8585
In general, the output sent to **stdout** by a native command is sent to the **Success** stream in
8686
PowerShell. Output sent to **stderr** by a native command is sent to the **Error** stream in
@@ -98,8 +98,8 @@ behavior can cause confusion in PowerShell when looking through errors and the a
9898
information can be lost if `$ErrorActionPreference` is set to a state that mutes the output.
9999

100100
PowerShell 7.3 added a new experimental feature `PSNativeCommandErrorActionPreference` that allows
101-
you to control whether output to `stderr` is treated as an error. For more information, see
102-
[`$PSNativeCommandUseErrorActionPreference`][6].
101+
you to control how you handle non-zero exit codes from native commands. For more information, see
102+
[`$PSNativeCommandUseErrorActionPreference`][05].
103103

104104
## Running PowerShell commands
105105

@@ -112,7 +112,7 @@ the PowerShell scripting language itself.
112112
The PowerShell **call operator** (`&`) lets you run commands that are stored in variables and
113113
represented by strings or script blocks. You can use the operator to run any native command or
114114
PowerShell command. This is useful in a script when you need to dynamically construct the
115-
command-line parameters for a native command. For more information, see the [call operator][7].
115+
command-line parameters for a native command. For more information, see the [call operator][01].
116116

117117
The `Start-Process` cmdlet can be used to run native commands, but should only be used when you need
118118
to control how the command is executed. The cmdlet has parameters to support the following
@@ -136,7 +136,7 @@ $processOptions = @{
136136
Start-Process @processOptions
137137
```
138138

139-
For more information, see [Start-Process][8].
139+
For more information, see [Start-Process][09].
140140

141141
On Windows, the `Invoke-Item` cmdlet performs the default action for the specified item. For
142142
example, it runs an executable file or opens a document file using the application associated with
@@ -149,15 +149,15 @@ The following example opens the PowerShell source code repository in your defaul
149149
Invoke-Item https://github.com/PowerShell/PowerShell
150150
```
151151

152-
For more information, see [Invoke-Item][9].
152+
For more information, see [Invoke-Item][08].
153153

154154
<!-- link references -->
155-
[1]: /powershell/module/microsoft.powershell.core/about/about_parsing#passing-arguments-to-native
156-
[2]: /powershell/module/microsoft.powershell.core/about/about_quoting_rules
157-
[3]: /powershell/module/microsoft.powershell.core/about/about_preference_variables#psnativecommandargumentpassing
158-
[4]: /powershell/module/microsoft.powershell.core/about/about_redirection
159-
[5]: /powershell/module/microsoft.powershell.core/about/about_output_streams
160-
[6]: /powershell/module/microsoft.powershell.core/about/about_preference_variables#psnativecommanduseerroractionpreference
161-
[7]: /powershell/module/microsoft.powershell.core/about/about_operators#call-operator-
162-
[8]: /powershell/module/microsoft.powershell.management/start-process
163-
[9]: /powershell/module/microsoft.powershell.management/invoke-item
155+
[01]: /powershell/module/microsoft.powershell.core/about/about_operators#call-operator-
156+
[02]: /powershell/module/microsoft.powershell.core/about/about_output_streams
157+
[03]: /powershell/module/microsoft.powershell.core/about/about_parsing#passing-arguments-to-native
158+
[04]: /powershell/module/microsoft.powershell.core/about/about_preference_variables#psnativecommandargumentpassing
159+
[05]: /powershell/module/microsoft.powershell.core/about/about_preference_variables#psnativecommanduseerroractionpreference
160+
[06]: /powershell/module/microsoft.powershell.core/about/about_quoting_rules
161+
[07]: /powershell/module/microsoft.powershell.core/about/about_redirection
162+
[08]: /powershell/module/microsoft.powershell.management/invoke-item
163+
[09]: /powershell/module/microsoft.powershell.management/start-process

0 commit comments

Comments
 (0)