Skip to content

File-Based Registry Support Needed for PowerShell #1187

Closed

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.

  1. Two configuration file directories are needed
    1. $PSHOME\Configuration -- Holds HKLM registry values; "System-wide"
    2. SpecialFolder.LocalApplicationData -- Holds HKCU registry values; "per-user"
      • Windows = %LOCALAPPDATA%\PowerShell\Configuration
      • non-Windows = ~/.config/PowerShell/Configuration
  2. Each registry key is a separate file
    1. The file name is the key and the content is the value. All values are strings or easily converted to and from strings.
    2. Preferred file format is JSON, but it may be unnecessary given one-key-per-file.
    3. Positives
      1. Mitigates multi-process reader & writer issues
      2. Allows per-file access control
    4. Negatives
      1. More files to manage
      2. 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

  1. added
    Area-SideBySide
    on Jun 23, 2016
  2. modified the milestones: , Aug17 on Jul 20, 2016
  3. daxian-dbw commented on Jul 27, 2016

    @daxian-dbw
    Member

    PipeLineMaxStackSizeMB
    Existing Key = HKLM\SOFTWARE\Microsoft\PowerShell\1\ShellIds
    Proposed value = Existing default. Probably "10"

    This key is not needed for CoreCLR PS because there is no way to specify the max stack size for a thread in CoreCLR.

  4. changed the title [-]File-Based Registry Support Needed for Open PowerShell[/-] [+]File-Based Registry Support Needed for PowerShell[/+] on Aug 17, 2016
  5. added a commit that references this issue on Aug 6, 2026
    e68c3c1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area-SideBySide

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions