Skip to content

Some cmdlets and config require writing to $PSHOME\SessionConfig folder #9278

Description

@SteveL-MSFT

Summary of the new feature/enhancement

For Snap and AppX packages of PSCore6, $PSHOME is effectively read-only. Any configuration stored in $PSHOME needs to be in a different location. On Windows 10, it would make sense to be in $env:SystemDrive\ProgramData.

Register-PSSessionConfiguration stores the config file in $PSHOME\SessionConfig folder.

powershell.config.json for the system is stored in $PSHOME, this means that admins can't set system wide config and cmdlets like Enable-ExperimentalFeature -Scope AllUsers won't work.

Update-Help -Scope AllUsers also won't work as it's stored in $PSHOME.

When this is fixed, test changes relying on Test-CanWriteToPsHome should be reverted.


Update — scope narrowed; solved via the MachineFolder data store

The pieces this issue originally enumerated are now split up:

This issue is narrowed to the SessionConfig .pssc write-location: Register/Set-PSSessionConfiguration copy the .pssc into $PSHome\SessionConfig (Utils.DefaultPowerShellAppBase, CustomShellCommands.cs:950), which is read-only under MSIX. The fix mirrors the profile relocation — Utils.GetPackagedMachineDataStorePath() ?? AppBase + \SessionConfig.

WinRM / remoting activation under MSIX (native pwrshplugin.dll registration) remains a separate concern tracked in #27563. Tracked under #27565.

Metadata

Metadata

Labels

Committee-ReviewedPS-Committee has reviewed this and made a decisionIn-PRIndicates that a PR is out for the issueIssue-Enhancementthe issue is more of a feature request than a bugKeepOpenThe bot will ignore these and not auto-closePackage-MSIXIssue occurs with MSIX packageWG-RemotingPSRP issues with any transport layer

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions