Skip to content

PS7-packaged: provide a cmdlet to export the fully merged / effective configuration #27698

Description

@jshigetomi

Tracked by #27565 · Design: #27697

Summary

With the per-machine data store ("MachineFolder", #27697), the effective PowerShell configuration is now merged across three scopes — MachineFolder, $PSHOME (product defaults), and CurrentUser — and the precedence differs between policy settings (system wins) and preference settings (user wins). There is currently no supported way to see the resolved result. PowerShellConfig is internal, and reading the raw powershell.config.json files by hand no longer reflects what the engine actually applies.

This is a diagnostic gap for administrators: after setting machine-wide policy, they cannot easily confirm the effective execution policy, WinCompat deny list, experimental-feature state, logging config, etc., or which scope won.

Proposal

Provide a read-only cmdlet that emits the fully merged, effective configuration (as JSON), for example:

Get-PSConfiguration [-Scope <MachineFolder|AllUsers|CurrentUser>] [-Effective]
  • -Effective (default): the merged result the engine actually uses, honoring policy-vs-preference precedence.
  • -Scope: dump a single scope's raw contents.
  • Ideally annotate each setting with the scope that "won", to make troubleshooting precedence straightforward.

The cmdlet name/shape is open for design (Get-PSConfiguration, Export-PSConfiguration, Get-PSConfiguration -AsJson, …) and needs Working Group sign-off — no public configuration cmdlet exists today.

Acceptance criteria

  • Emits JSON that matches the engine's actual merge (policy → system-wins, preference → user-wins).
  • Works both packaged and unpackaged (unpackaged simply has no MachineFolder scope, so results collapse to the legacy two-scope merge).
  • Strictly read-only; never writes a config file.
  • Preferably reports the winning source scope per setting.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugPackage-MSIXIssue occurs with MSIX packageWG-Cmdletsgeneral cmdlet issuesWG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions