Maintain user-level experimental-feature configuration separately for preview and stable versions
See original GitHub issueRelated: #14862
Summary of the new feature/enhancement
Currently, selective enabling or disabling experimental features at the user level (-Scope CurrentUser
, which is the default) takes effect for all side-by-side PowerShell (Core) installations, irrespective of whether they’re stable versions or preview versions.
This can unwittingly result in the following scenario:
- By selectively disabling an experimental feature in a preview version, you’re implicitly enabling experimental features for side-by-side stable versions, because the same
powershell.config.json
file is used by all side-by-side version, and because disabling is based on excluding the disabled feature from the list of explicitly enumerated enabled features in that file (based on the all-enabled starting point in preview versions).
The state of experimental features for preview versions should be managed separately from stable versions.
An additional question is how to handle cross-preview-version configuration:
-
Say you disable an experimental feature in a preview version (where all features are enabled by default).
-
You later install a new preview version that comes with new experimental features.
-
With a version-agnostic configuration, it isn’t just the previously explicitly disabled feature that ends up disabled, but all newly added ones as well.
Proposed implementation:
Introduce a new property in the user-level powershell.config.json
file:
-
named something like
DisabledPreviewExperimentalFeatures
, which is only read by preview versions, instead of theExperimentalFeatures
property. -
whose logic is the inverse of
ExperimentalFeatures
: all features except the ones listed should then be enabled.
Written as of PowerShell Core 7.2.0-preview.3
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (8 by maintainers)
Top GitHub Comments
The current-user scope configuration file doesn’t come with PowerShell package. It’s created by user (explicitly, or via
Enable-ExperimentalFeature
command), so I don’t think this will affect MU.@doctordns Consider there may be non-PowerShell-built-in modules in the module path that define experimental features, it’s not possible to list all experimental features until at PowerShell run time.