PowerShell / PowerShell/PSResourceGet

Request to change default installation path for user modules

Open
#724 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature_request
Dominant language
C#
Stars
576
Forks
114
Avg merge
1d 2h
Merged PRs (30d)
7

Description

Summary of the new feature / enhancement

In the latest versions of OneDrive, the Documents folder is synchronized by default. This creates challenges for PowerShell users. Some might not want modules to "roam" between machines. In other cases, an organizational "My" folder always contains two spaces in the name following the pattern "OneDrive - OrgName". The spaces require using an 8.3 folder name or putting the path in quotations, which is extra work.

A community-suggested workaround is to move the default module path. The discussion resolved the best location to be ~/AppData/Local/PowerShell/Modules. The PowerShell committee has discussed and agrees with the approach and acknowledges that multiple steps in a coordinated effort will be required to reach the end goal without breaking compatibility.

https://github.com/PowerShell/PowerShell/issues/15552

Proposed technical implementation details (optional)

Two options for consideration, regarding Install-PSResource:

1 - Add a new parameter -InstallPath and set the default to $Env:HOMEPATH\AppData\Local\PowerShell\Modules.
2 - Just change the path where modules are installed to $Env:HOMEPATH\AppData\Local\PowerShell\Modules, without adding a parameter.

Additional options and considerations are welcome. If this is accepted, PWSH could add the path to PSModulePath (in addition to the existing) in a near-term release.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked PowerShell issue #15552 and the Install-PSResource implementation that determines the default module installation path. Compare the proposed -InstallPath option with changing the default directly, then confirm that the selected approach preserves compatibility and supports the planned PSModulePath update.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.