Skip to content

Return a more actionable error description when the user attempts to write to an MSIX-installation's root. #25733

@RokeJulianLockhart

Description

@RokeJulianLockhart

Summary of the new feature / enhancement

I want to execute any of the commands that learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5#known-limitations disallows: 1

  1. Register-PSSessionConfiguration

  2. Update-Help -Scope AllUsers

  3. Enable-ExperimentalFeature -Scope AllUsers

  4. Set-ExecutionPolicy -Scope LocalMachine

As an example, when I invoke Set-ExecutionPolicy -Scope LocalMachine, I see similar to:

Access to the path '$Env:ProgramFiles\WindowsApps\Microsoft.PowerShellPreview_7.6.4.0_x005F_x64__8wekyb3d8bbwe\powershell.config.json' is denied. To change the execution policy for the default (LocalMachine) scope, start PowerShell with the "Run as administrator" option. To change the execution policy for the current user, run "Set-ExecutionPolicy -Scope CurrentUser".

Considering that PowerShell knows that it's been installed with Add-AppxPackage, it knows the cause of this. Consequently, the user should be informed of the reason, or it should cite the relevant documentation.

Proposed technical implementation details (optional)

No response

Footnotes

  1. discussions/25729#discussioncomment-13676474

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Enhancementthe issue is more of a feature request than a bugNeeds-TriageThe issue is new and needs to be triaged by a work group.WG-Cmdletsgeneral cmdlet issuesWG-NeedsReviewNeeds a review by the labeled Working Group

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions