Experimental features
PowerShell 7 uses experimental features to make some new functionality available, which are not yet considered to be mainstream features. Features may be added to a later release of PowerShell, or discarded if they are not successful.
Three commands are available for working with experimental features:
Enable-ExperimentalFeature
Disable-ExperimentalFeature
Get-ExperimentalFeature
Get-ExperimentalFeature
can be used to view the available features. The list of features changes depending on the version of PowerShell. The following list has been taken from PowerShell 7.3.3.
PS> Get-ExperimentalFeature
Name Enabled Source Description
---- ------- ------ -----------
PSCommandNotFoundSuggestion False PSEngine Recommend…
PSLoadAssemblyFromNativeCode False PSEngine Expose an API…
PSNativeCommandErrorActionPreferen… False PSEngine Native comman…
PSSubsystemPluginModel False PSEngine A plugin mode…
In addition to the output shown here, each feature has a description. Format-Table
can be used to view these descriptions:
Get-ExperimentalFeature | Format-Table Name, Description -Wrap
The use of these commands is described in the About_Experimental_Features
help file.
If an experimental feature is enabled, PowerShell must be restarted for us to use the feature. For example, PSCommandNotFoundSuggestion
can be enabled:
Enable-ExperimentalFeature -Name PSCommandNotFoundSuggestion
Once enabled, if a command is spelled incorrectly in the console, PowerShell will suggest possible command names alongside the error message:
PS> Get-Procss
Get-Procss: The term 'Get-Procss' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Suggestion [4,General]: The most similar commands are: Get-Process, Wait-Process, Get-Host, Get-DbaProcess.
If the feature is no longer wanted, it can be disabled again:
Disable-ExperimentalFeature -Name PSCommandNotFoundSuggestion
In the past, several experimental features have become permanent features in PowerShell.