-
Notifications
You must be signed in to change notification settings - Fork 137
Move PS content out of OneDrive #388
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 6 commits
828a981
9901f90
e9808dc
60ee0ab
95798e0
f35150d
e29eb58
239989a
310b1c5
1ea449f
75e359c
53e3c89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| --- | ||
| RFC: RFC0066 | ||
| Author: Justin Chung | ||
| Status: Draft | ||
| SupercededBy: N/A | ||
| Version: 1.0 | ||
| Area: Core | ||
| Comments Due: 05/03/2025 | ||
| Plan to implement: Yes | ||
| --- | ||
|
|
||
| # PowerShell User Content Location | ||
|
|
||
| This RFC proposes moving the current PowerShell user content location out of OneDrive to the AppData directory on Windows machines. | ||
|
|
||
| ## Motivation | ||
|
|
||
| - PowerShell currently places profile, modules, and configuration files in the user's Documents folder, which is against established conventions for shell configurations and tools. | ||
| - PowerShell content files in OneDrive can lead to unwanted syncing of module files, leading to various issues. | ||
| - There is strong community demand for changing this behavior as the current setup is problematic for many users. | ||
| - Changing the default location would align PowerShell with other developer tools and improve usability. | ||
|
|
||
| As a user, | ||
| I can customize the location where PowerShell user content is installed, | ||
| so that I can avoid problems created by file sync solutions like OneDrive. | ||
|
|
||
| ## User Experience | ||
|
|
||
| - On startup PowerShell will create a directory in AppData and a configuration file. | ||
| - In the configuration file the user scoped PSModulePath will point to AppData/PowerShell/Modules. | ||
| - Users can opt out of this new location by specifying a desired user scoped module path in the configuration file. | ||
|
|
||
| ## Specification | ||
|
|
||
| - The content folder location change will only apply to PowerShell on Windows. | ||
| - Configurability of the content folder will apply to all systems. | ||
| - This will be an experimental feature. | ||
| - The PowerShell user content folder will be located in the `$env:LOCALAPPDATA\Microsoft\PowerShell`. | ||
| - A configuration file in the PowerShell user content folder will determine the location of the user scoped PSModulePath. | ||
| - The user will be responsible for specifying thier desired install location using PSResourceGet. | ||
| - The location of Modules is configurable | ||
| - The location of this folder is not configurable. | ||
| - The proposed directory structure: | ||
|
|
||
| C:\Users\UserName\AppData\Local\PowerShell\ | ||
| ├── PSContent (Configurable) | ||
| └── PSModulePathConfig.json (Not Configurable) | ||
|
|
||
| PSContent (Configurable) | ||
| ├── Scripts (Not Configurable) | ||
| ├── Modules (Not Configurable) | ||
| ├── Help (Not Configurable) | ||
| └── profile.ps1 (Not Configurable) | ||
|
|
||
| - The configuration file: | ||
|
|
||
| ```json | ||
| { | ||
| "UserPSContentPath" : "C:\\Users\\User\\PowerShell" | ||
| } | ||
| ``` | ||
|
|
||
| ## Alternate Proposals and Considerations | ||
|
|
||
| - The following functionalities will be affected: | ||
| - SecretManagement | ||
| - SecretManagement extension vaults are registered for the current user context in: | ||
| `$env:LOCALAPPDATA\Microsoft\PowerShell\secretmanagement\secretvaultregistry\` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is why we need to keep it in this |
||
|
|
||
| When an extension vault is registered, SecretManagement stores the full path to the extension | ||
| module in the registry. Moving the PowerShell content to a new location will break the vault | ||
| registrations. | ||
| - Use the following script to relocate the PowerShell contents folder: | ||
|
|
||
| ```pwsh | ||
| $newPath = "C:\Custom\PowerShell\Modules" | ||
| $currentUserModulePath = [System.Environment]::GetFolderPath('MyDocuments') + "\PowerShell\Modules" | ||
| Move-Item -Path $currentUserModulePath -Destination $newPath -Force | ||
| ``` | ||
|
Comment on lines
+101
to
+105
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you may want to have a script to show users what vault modules are registered today and their hardcoded paths in the registration. |
||
Uh oh!
There was an error while loading. Please reload this page.