Repository navigation
Description
Overview
In PowerShell repo, there is a need to decouple as much as possible from PowerShell's existing dependence on the Windows registry. This requirement is driven by a lack of a registry in non-Windows environments and a need to isolate side-by-side instances of PowerShell from interfering with each other's operation.
- Two configuration file directories are needed
- $PSHOME\Configuration -- Holds HKLM registry values; "System-wide"
- SpecialFolder.LocalApplicationData -- Holds HKCU registry values; "per-user"
- Windows = %LOCALAPPDATA%\PowerShell\Configuration
- non-Windows = ~/.config/PowerShell/Configuration
- Each registry key is a separate file
- The file name is the key and the content is the value. All values are strings or easily converted to and from strings.
- Preferred file format is JSON, but it may be unnecessary given one-key-per-file.
- Positives
- Mitigates multi-process reader & writer issues
- Allows per-file access control
- Negatives
- More files to manage
- May be unnecessary; no data to confirm whether it is an actual performance bottleneck
Values Needed:
PSModulePath
Existing Key = HKLM:\System\CurrentControlSet\Control\Session Manager\Environment
Proposed value = %ProgramFiles%\PowerShell\Modules by default
DisablePromptToUpdateHelp
Existing Key = HKLM\SOFTWARE\Microsoft\PowerShell
Proposed value = Existing default. Probably "0"
PipeLineMaxStackSizeMB
Existing Key = HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds
Proposed value = Existing default. Probably "10"
ConsolePrompting
Existing Key = HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds
Proposed value = existing default. Probably "1"
ExecutionPolicy
Existing Key = HKCU and HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell
Proposed value = existing default execution policy
DefaultSourcePath
Existing Key = HKCU and HKLM\Software\Policies\Microsoft\Windows\PowerShell\UpdatableHelp
Proposed value = blank. This should be supported though
Note: Storage of machine-level and user-level environment variables is still an open topic. We can store them in files, but we might want to leave them as-is (written to registry) in Windows.
Tasks
- Merge portions of the prototype code and add it to the build
- Write new class for reading from and writing to JSON files
- Replace calls within PS code to use the new interface
- Write tests and verify functionality
Activity
daxian-dbw commentedon Jul 27, 2016
This key is not needed for CoreCLR PS because there is no way to specify the max stack size for a thread in CoreCLR.
[-]File-Based Registry Support Needed for Open PowerShell[/-][+]File-Based Registry Support Needed for PowerShell[/+]Merge pull request PowerShell#1530 from PowerShell/mirichmo/file-base…