Skip to content
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

Add initial draft #388

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Add initial draft #388

wants to merge 6 commits into from

Conversation

jshigetomi
Copy link

This pull request proposes a new RFC (RFC0066) to change the default location of PowerShell user content on Windows machines from OneDrive to the AppData directory. The goal is to align PowerShell with other developer tools and improve usability by preventing unnecessary syncing issues.

Key changes include:

  • Introduction of RFC0066 to move PowerShell user content to the AppData directory on Windows.
  • Specification of the new directory structure in AppData and the creation of a configuration file to manage the user scoped PSModulePath.
  • Allowing users to customize the location of PowerShell user content, with certain directories being non-configurable.
  • Providing an example script to relocate existing PowerShell content to the new location.

Copy link
Contributor

@sdwheeler sdwheeler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are many more comments and questions I want to add. But start with these changes.


- This change will only apply to PowerShell on Windows.
- This will be an experimental feature.
- The PowerShell user content folder will be located in the AppData.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- The PowerShell user content folder will be located in the AppData.
- The PowerShell user content folder will be located in the `"$env:LOCALAPPDATA\PowerShell"`.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or should this be "$env:LOCALAPPDATA\Microsoft\PowerShell"? The already use this location module cache and SecretManagement.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$env:LOCALAPPDATA\Microsoft\PowerShell makes more sense

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should get @SteveL-MSFT feedback. I prefer to not create yet another PowerShell folder somewhere, but that folder get very full of files.

- The proposed directory structure:

C:\Users\UserName\AppData\Local\PowerShell\
├── Modules (Configurable)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why aren't we allowing the location of the content folder to be changed? I want all my user files in one location, I don't want modules in one place and scripts/profiles in another.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. So only the location of the config file itself is not configurable and all other files is configurable through the config file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. So only the location of the config file itself is not configurable

Correct. Whether the other locations are configurable is open to discussion. My vision was that we would only allow configuration of the PSContentPath. Everything else would be in that location.

PSContentPath (configurable)
├── Scripts (Not Configurable)
├── Modules (Not Configurable)
├── Help (Not Configurable)
├── profile.ps1 (Not Configurable)

Comment on lines 52 to 54
{
"PSModulePath" : "C:\\Users\\chungjustin\\PowerShell"
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PSModulePath is already a value used in the config file. I suggest changing the name for this configuration to UserPSModulePath. If we allow rehoming of the content folder then use UserPSContentPath.

Use the suggested formatting.

Suggested change
{
"PSModulePath" : "C:\\Users\\chungjustin\\PowerShell"
}
```json
{
"PSModulePath" : "C:\\Users\\chungjustin\\PowerShell"
}
```

Question: Should setting PSModulePath and the user paths be mutually exclusive?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think making them not mutually exclusive is a good idea. And maybe even separating the scripts and profile out too?

{
"PSModulePath": "C:\Users\user\PowerShell",
"UserPSModulePath": "C:\Users\user\PowerShell",
"UserPSContentPath": "C:\Users\user\PowerShellContent"
"UserScriptPath": "C:\Users\user\PowerShellContent"
"UserProfilePath": "C:\Users\user\PowerShellContent"
}

Copy link
Contributor

@sdwheeler sdwheeler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More comments

- The proposed directory structure:

C:\Users\UserName\AppData\Local\PowerShell\
├── Modules (Configurable)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. So only the location of the config file itself is not configurable

Correct. Whether the other locations are configurable is open to discussion. My vision was that we would only allow configuration of the PSContentPath. Everything else would be in that location.

PSContentPath (configurable)
├── Scripts (Not Configurable)
├── Modules (Not Configurable)
├── Help (Not Configurable)
├── profile.ps1 (Not Configurable)

- The location of this folder is not configurable.
- The proposed directory structure:

C:\Users\UserName\AppData\Local\PowerShell\
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdwheeler Is this directory structure and configurability setup what you mean?

@iSazonov
Copy link
Contributor

iSazonov commented Apr 8, 2025

The file should have .md extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants