Skip to content

Commit 27894a4

Browse files
authored
Merge pull request #148 from SteveL-MSFT/expermental-feature-user-experience
Draft of experimental feature user experience RFC
2 parents 49970be + 37999c0 commit 27894a4

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
RFC: RFC0000
3+
Author: Steve Lee
4+
Status: Draft
5+
SupercededBy: N/A
6+
Version: 1.0
7+
Area: Microsoft.PowerShell.Core
8+
Comments Due: 12/1/2018
9+
Plan to implement: Yes
10+
---
11+
12+
# Experimental Feature User Experience
13+
14+
[Experimental Feature Flags](https://github.com/PowerShell/PowerShell-RFC/blob/master/5-Final/RFC0029-Support-Experimental-Features.md)
15+
enable developers to expose experimental features to users to gather feedback before finalizing design.
16+
That feature was focused on the developer and did not make it easy for users to discover and enable experimental features.
17+
This RFC addresses the user experience.
18+
19+
## Motivation
20+
21+
As a PowerShell user,
22+
I can discover and enable experimental features,
23+
so that I can try new capabilities safely and provide feedback.
24+
25+
## Specification
26+
27+
### Get-ExperimentalFeature *Breaking Change*
28+
29+
Currently, `Get-ExperimentalFeature` requires the `-ListAvailable` switch to enumerate available experimental features.
30+
This was modeled after `Get-Module -ListAvailable`.
31+
Without the switch, `Get-ExperimentalFeature` only shows the enabled experimental features, which by default is none.
32+
Most users will try this cmdlet without the switch and assume there are no experimental features to try.
33+
34+
Since there are likely not many experimental features available at any point in time and less enabled,
35+
it would make sense to remove the `-ListAvailable` switch and simply display all experimental features.
36+
The current output already has a column indicating if the experimental feature is enabled allowing for easy filtering.
37+
38+
### System and User scope powershell.config.json
39+
40+
Enabling experimental features automatically requires creating or updating a `powershell.config.json` file in `$PSHOME`
41+
which is read at startup which affects all users or from `$HOME\Documents\PowerShell\powershell.config.json` on Windows
42+
and from `$HOME/.config/powershell/powershell.config.json` on Linux and macOS per user.
43+
44+
Experimental features are currently not being read from the user config and this RFC will enable reading
45+
of the user config in addition to the system config.
46+
In the case where the user config exists, it will take precedence over the system config for experimental features
47+
in that the system config is not read for experimental features.
48+
System config is not policy so this should be acceptable and expected.
49+
50+
### Enable and Disable cmdlets
51+
52+
```none
53+
Enable-ExperimentalFeature [[-Name] <string[]>] [-Scope { CurrentUser | AllUsers }] [<CommonParameters>]
54+
55+
Disable-ExperimentalFeature [[-Name] <string[]>] [-Scope { CurrentUser | AllUsers }] [<CommonParameters>]
56+
```
57+
58+
These cmdlets allow users to selectively enable and disable experimental features.
59+
60+
The `-Name` parameter shall accept `ValueFromPipelineByPropertyName` and is the name of the experimental feature.
61+
62+
The `-Scope` parameter is optional and defaults to `CurrentUser` and will create or update the
63+
`powershell.config.json` in `$HOME\Documents\PowerShell\powershell.config.json` on Windows
64+
and from `$HOME/.config/powershell/powershell.config.json` on Linux and macOS.
65+
If `-Scope` is `AllUsers`, it will create or update `$PSHOME\powershell.config.json`.
66+
67+
Experimental features are read and enabled at PowerShell startup, so a warning message will be provided informing the user:
68+
> Experimental feature changes will only be applied after restarting PowerShell.
69+
70+
Upon success, there is no output other than the warning message.
71+
72+
## Alternate Proposals and Considerations
73+
74+
### Enabled property
75+
76+
Currently, an experimental feature has an `Enabled` property that is `true` or `false`.
77+
In addition to the warning message that a restart is required after changing experimental feature status,
78+
the `Enabled` property could be changed to an enum instead of a boolean: True, False, Pending.
79+
However, since experimental features is expected to be used by more advanced users,
80+
this seems unnecessary.
81+
82+
Alternatively, we can add a `RestartRequired` property to indicate an enabled feature is pending.
83+
84+
### Features that were previously Experimental
85+
86+
In the case where an Experimental Feature no longer experimental (whether accepted or rejected),
87+
the config file may still have that feature listed.
88+
We can add a `State` property that has enum values: Available, NotAvailable.
89+
This `State` can also convey the `RestartRequired` state.
90+
If this becomes a problem in the future, we can have cmdlets to help clean-up non-valid settings in the
91+
configuration (which will be more than just experimental features).
92+
Since this is additive, this is currently outside the scope of this RFC.
93+
94+
### PowerShell instance specific configuration
95+
96+
The system (AllUsers) configuration is in `$PSHOME` and specific to that instance of PowerShell.
97+
The user config is global to all instances of PowerShell which can create problems.
98+
For experimental features, this is not a big issue as experimental features listed to
99+
be enabled in the config file that don't exist are silently ignored.
100+
However, other configuration that one may want to apply to a preview release and not a
101+
stable release cannot be applied except for AllUsers currently.
102+
This should be addressed in a separate configuration RFC.

0 commit comments

Comments
 (0)