Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use a dedicated configuration directory path for all-users profiles on non-windows systems.#25748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
dviererbe wants to merge1 commit intoPowerShell:master
base:master
Choose a base branch
Loading
fromdviererbe:feat/SeparateAllUsersFolderPath

Conversation

dviererbe
Copy link

PR Summary

PowerShell should search in a dedicated directory (other than the installation directory) for the all-users profile to adhere to theFilesystem Hierarchy Standard (FHS).

PR Context

Currently the all-users profiles are stored in the installation directory. Unix-based systems and derivatives mostly follow recommendations of the FHS. The FHS recommends to place configuration files into the/etc directory.

For example, here are the locations of the system wide configuration files of other popular shells:

  • bash(1):/etc/bash.bashrc (Debian/Ubuntu) or/etc/bashrc (RedHat/Fedora)
  • zsh(1):/etc/zshrc
  • fish(1):/etc/fish/config.fish

I took inspiration from where NuGet is locating its system-wide configuration, seeNuGet config file locations:

This commit introduces the environment variablePOWERSHELL_COMMON_APPLICATION_DATA.
If this variable is neither null nor empty, then this location is used. This allows distros that do not follow the FHS to customize the location.

  • On Windows PowerShell keeps using the installation directory.
  • On macOS PowerShell uses the/Library/Application Support/PowerShell directory.
  • Otherwise PowerShell uses/etc/opt/powershell.

This change is also needed to make the all-users profile usable when installing powershell via a snap, seecanonical/powershell-snaps#14

Fixes:#20336,#25007

PR Checklist

Currently the all-users profiles are stored in theinstallation directory. Unix-based systems andderivatives mostly follow recommendations of theFilesystem Hierarchy Standard [FHS]. The FHSrecommends to place configuration files into the/etc directory.For example, here are the locations of the systemwide configuration files of other popular shells:- bash(1): /etc/bash.bashrc (Debian/Ubuntu) or           /etc/bashrc (RedHat/Fedora)- zsh(1):  /etc/zshrc- fish(1): /etc/fish/config.fishI took inspiration from where NuGet is locating itssystem-wide configuration, see [NuGet config file locations]:This commit introduces the environment variable`POWERSHELL_COMMON_APPLICATION_DATA`.If this variable is neither null nor empty, thenthis location is used. This allows distros that donot follow the FHS to customize the location.On Windows PowerShell keeps using the installation directory.On macOS PowerShell uses the `/Library/Application Support/PowerShell` directory.Otherwise PowerShell uses `/etc/opt/powershell`.[FHS]:https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html[NuGet config file locations]:https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior#config-file-locations-and-usesFixes:PowerShell#20336,PowerShell#25007Signed-off-by: Dominik Viererbe <dominik.viererbe@canonical.com>
@dviererbe
Copy link
Author

@microsoft-github-policy-service agree company="Canonical Ltd."

@microsoft-github-policy-servicemicrosoft-github-policy-servicebot added the Waiting on AuthorThe PR was reviewed and requires changes or comments from the author before being accept labelJul 14, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
Waiting on AuthorThe PR was reviewed and requires changes or comments from the author before being accept
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AllUsers profile directories READ-ONLY (PS 7.3.7, WSL2, Ubuntu 22.04)
1 participant
@dviererbe

[8]ページ先頭

©2009-2025 Movatter.jp