-
Notifications
You must be signed in to change notification settings - Fork 129
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
Open
jshigetomi
wants to merge
7
commits into
PowerShell:master
Choose a base branch
from
jshigetomi:RFC0066
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
828a981
Add initial draft
9901f90
Fix date
e9808dc
Reword motivation and specification
60ee0ab
Edits from first revision
95798e0
Edits from second revision
f35150d
Added .md extension
e29eb58
Edits from third revision
jshigetomi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
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 causes unnecessary syncing of configuration 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 of where PowerShell user content is installed, | ||
so that I can choose to sync with 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 | ||
|
||
- This change will only apply to PowerShell on Windows. | ||
jshigetomi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- This will be an experimental feature. | ||
- The PowerShell user content folder will be located in the AppData. | ||
jshigetomi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 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\ | ||
jshigetomi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
├── Modules (Configurable) | ||
jshigetomi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
├── Scripts (Not Configurable) | ||
├── Profiles (Not Configurable) | ||
jshigetomi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
└── PSModulePathConfig.json (Not Configurable) | ||
|
||
- The proposed json file: | ||
|
||
{ | ||
"PSModulePath" : "C:\\Users\\chungjustin\\PowerShell" | ||
} | ||
jshigetomi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Alternate Proposals and Considerations | ||
|
||
- The following functionalities will be affected: | ||
- Secret Management. | ||
jshigetomi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 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 | ||
``` | ||
jshigetomi marked this conversation as resolved.
Show resolved
Hide resolved
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.