Skip to content

Commit

Permalink
(GH-10661) Fix $PSNativeCommandUseErrorActionPreference default (#1…
Browse files Browse the repository at this point in the history
…0664)

Prior to this change, the documentation for the `$PSNativeCommandUseErrorActionPreference`
variable noted that it defaults to `$true` starting in PowerShell 7.4.

The different default value was temporary for gathering feedback while
7.4 was in preview. When 7.4 was released as stable, the default value
was reverted to `$false` in PowerShell/PowerShell#20285.

This change:

- Replaces the misleading sentence with one that states the defaultc
  value as `$true`.
- Fixes #10661
  • Loading branch information
michaeltlombardi authored Nov 20, 2023
1 parent 71dac04 commit 97348a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions reference/docs-conceptual/learn/experimental-features.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: Lists the currently available experimental features and how to use them.
ms.date: 11/14/2023
ms.date: 11/20/2023
title: Using Experimental Features in PowerShell
---
# Using Experimental Features in PowerShell
Expand Down Expand Up @@ -317,9 +317,9 @@ To enable this feature, run the following commands:
Enable-ExperimentalFeature PSNativeCommandErrorActionPreference
```

You must start a new PowerShell session for this change to be in effect. Beginning in PowerShell
7.4, `$PSNativeCommandUseErrorActionPreference` is set to `$true` by default. With the preference
set to `$true` you get the following behavior:
You must start a new PowerShell session for this change to be in effect.
`$PSNativeCommandUseErrorActionPreference` is set to `$true` by default. With the preference set to
`$true` you get the following behavior:

- When `$ErrorActionPreference = 'Stop'`, scripts will break when a native command returns a
non-zero exit code.
Expand Down

0 comments on commit 97348a5

Please sign in to comment.