Repository navigation
Show what experimental features are turned on at the start of interactive sessions #14862
Description
Summary of the new feature/enhancement
For an interactive PowerShell user it is important to know if and what experimental features are currently enabled - if any.
-
In a stable / LTS version, the expectation may be that NONE are enabled, so if any are, it's helpful to be notified.
- Experimental features may inadvertently be enabled, namely if, in a previously installed or side-by-side preview version features were ever selectively enabled or disabled with
-Scope CurrentUser- which is the default scope. The resulting"$(Split-Path $PROFILE.CurrentUserAllHosts)/powershell.config.json"file takes effect for all installed versions, and overrides"PSHOME/powershell.config.json"
- Experimental features may inadvertently be enabled, namely if, in a previously installed or side-by-side preview version features were ever selectively enabled or disabled with
-
In preview versions - which by default come with all experimental features enabled - it is additionally important to know which ones are not enabled in a given session, since, after using selective disabling, newly introduced features may end up DISABLED in preview versions installed later (as explained above).
- Additionally, showing in effect all experimental features helps with discovering new ones.
Proposed technical implementation details (optional)
Update: See the alternative, less verbose proposal below.
On entering an interactive session, show something like the following:
For PREVIEW versions:
Show both the enabled and disabled experimental features, grouped by state:
@"
PowerShell 7.2.0-preview.3
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
ENABLED experimental features:
$((Get-ExperimentalFeature | Where-Object -not Enabled).Name)
DISABLED experimental features:
$((Get-ExperimentalFeature | Where-Object Enabled).Name)
"@It would additionally be helpful if features added since the previous stable release could be highlighted.
For STABLE / LTS versions:
Show only enabled experimental features (if any - see @rkeithhill's more sophisticated version).
@"
PowerShell 7.2.0-preview.3
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
Enabled experimental features (type 'help about_experimental_features' for help):
$((Get-ExperimentalFeature | Where-Object -not Enabled).Name)
"@As @DHowett notes, all this extra text should be considered part of the "logo" and should therefore be suppressed if -NoLogo is passed to the CLI.
Activity
rkeithhill commentedon Feb 20, 2021
Or maybe this for stable:
Outputs this:
or this:
DHowett commentedon Feb 22, 2021
If we commit to this, I'd really hope that it's suppressed by
-NoLogo.rkeithhill commentedon Feb 22, 2021
I wish GitHub had more reaction emojis. I'd like to 💯 Dustin L. Howett (@DHowett)'s comment above. :-)
mklement0 commentedon Feb 22, 2021
I appreciate both suggestions. Dustin L. Howett (@DHowett), I've noted your suggestion in the OP; Keith Hill (@rkeithhill), I've linked to your improved command from the OP.
iSazonov commentedon Feb 22, 2021
This will rather annoy users as it does with the new version notification and the large logo (we already have such issues).
It would make sense as a one-time function of the installer to show release notes and turned on experimental features.
mklement0 commentedon Feb 22, 2021
I like that idea separately - it's not one or the other.
Given that not everyone uses official installers, that information is better shown in the terminal on first startup (unless suppressed with
-NoLogo). This should probably be a separate proposal.One person's annoyance is another person's feature.
As in the version notification case, to me the sensible default behavior is to show this information, while given users an opt-out - as we have done via the
POWERSHELL_UPDATECHECKenvironment variable.As for how much of an annoyance it would be:
In stable versions (including LTS):
In preview versions:
I suppose one way to reduce the amount of information shown is that if all experimental features are enabled, to only state that in the abstract, rather than enumerating all the feature names.
daxian-dbw commentedon Feb 22, 2021
/cc Joey Aiello (@joeyaiello) Jason Helmick (@theJasonHelmick) to comment.
JamesWTruher commentedon Feb 23, 2021
I'm really not in favor of a bunch of blather on the screen when I start the shell. I can easily find out what experimental features are enabled. If you need this personally, it's very easy to add it to your profile, but I don't believe you've made the argument sufficiently to enable this for all users every time the shell starts.
mklement0 commentedon Feb 23, 2021
The OP argues specific points, separately for stable and preview versions, including the point that in stable versions you normally wouldn't see additional information and that if something is shown it is important to show it, and that in preview versions you'd want to know which are and are not enabled.
Which of these arguments do you think are insufficient, and why?
mklement0 commentedon Feb 23, 2021
With respect to the amount of extra information shown, one way to reduce it is to apply exception logic, that is to effectively issue an abstract warning if the configuration is unusual, namely:
In a stable version, if at least one experimental feature is enabled, say something like:
WARNING: At least one experimental feature is in enabled. Type 'help about_experimental_features' for help.In a preview version, where all features are enabled by default, warn if at least one experimental feature is disabled:
WARNING: At least one experimental feature is in disabled. Type 'help about_experimental_features' for help.In practice, I suspect such warnings would rarely show if we stopped sharing user-level configuration files across side-by-side versions and if we reversed the exclusion logic for preview versions. Currently, it is very easy to unwittingly enable or disable experimental features - see #14891.
Andrew74L commentedon Jan 26, 2023
For preview versions I would prefer something short and sweet, such as:
PowerShell 7.4.0-preview.1 (Experimental features enabled. Use 'Get-ExperimentalFeature' for info.)Anything regarded as being a logo should be limited to one line. Anything longer should be considered a notice. A runonce notice that lists experimental features, would be appropriate for new version installations. Something like:
kilasuit commentedon Jan 28, 2023
Taking into consideration all comments in this thread, but especially pointing out both of Ilya (@iSazonov) & James Truher (@JamesWTruher) comments & other issues around the logo text what is suggested by Andrew74L above is almost what I think many in the community would overall deem reasonable. That said I think for others that may want a fuller output similar to what Keith Hill (@rkeithhill) show'd above, so I am raising some additional issues to discuss this and gain further feedback
theJasonHelmick commentedon Feb 8, 2023
Michael Klement (@mklement0) - Thank you for this suggestion. The working group believes that running
Get-ExperimentalFeatureis the appropriate way to determine this information.mklement0 commentedon Feb 10, 2023
That is disappointing.
As an example of the confusion that ensues when users aren't aware of what experimental features are in effect, especially when it changes fundamental behaviors, see #18944
iSazonov commentedon Feb 10, 2023
Such a short answer from WG explains nothing and gives no insight.
Actually the question was how best to inform users what's new.
Such a feeling that every member of WG said that he personally does not need it because he already knows everything. 😄
Although this question of "how best to tell users what's new" comes up all the time in different ways - not just about experimental features, but about breaking changes too.
Andrew74L commentedon Feb 10, 2023
Could the logo... PowerShell 7.3.2 ...be a hyperlink?
iSazonov commentedon Feb 10, 2023
Some terminals support this.
Although I see that users rather prefer not to have a logo. So we are left to consider only the option of a one-time display of information on the first startup. That's what VS Code does after an upgrade, for example.
daxian-dbw commentedon Feb 13, 2023
Ilya (@iSazonov) Can you please open a new issue describing this idea? Comparing with changing the startup logo, I think it's a better way to improve the user awareness of the changes in the shell. Please mark it to be reviewed by the "interactive-console" WG.
kilasuit commentedon Feb 13, 2023
Dongbo Wang (@daxian-dbw) / Ilya (@iSazonov) I have added it into this meta issue that I've got for tracking comments about logo/nologo which is already marked for
Interactive-consoleWG