-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Update behavior of PSModulePath in PS7 #5424
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
Merged
Merged
Changes from all commits
Commits
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 |
|---|---|---|
|
|
@@ -252,7 +252,7 @@ The environment variables that store preferences include: | |
| The default value of `$Env:PSModulePath` on Windows is: | ||
|
|
||
| ```powershell | ||
| $HOME\Documents\WindowsPowerShell\Modules;$PSHOME\Modules | ||
| $HOME\Documents\PowerShell\Modules;$env:PROGRAMFILES\PowerShell\Modules;$PSHOME\Modules | ||
| ``` | ||
|
|
||
| The default value of `$Env:PSModulePath` on Linux or macOS is: | ||
|
|
@@ -261,10 +261,14 @@ The environment variables that store preferences include: | |
| $HOME/.local/share/powershell/Modules:/usr/local/share/powershell/Modules:$PSHOME/Modules | ||
| ``` | ||
|
|
||
| PowerShell sets the value of `$PSHOME\Modules` in the registry. It sets the | ||
| value of `$HOME\Documents\PowerShell\Modules` each time you start PowerShell. | ||
| PowerShell will prefix the user module path, the shared module path, and the $PSHOME | ||
| module path to `PSModulePath` if it is not already in `PSModulePath`. | ||
|
|
||
| In addition, setup programs that install modules in other directories, such as | ||
| In addition, on Windows, if the inherited `PSModulePath` is the same as the one stored | ||
| as the user environment variable, then the machine `PSModulePath` environment variable | ||
| is appended to the end. | ||
|
|
||
| Also, setup programs that install modules in other directories, such as | ||
| the `Program Files` directory, can append their locations to the value of | ||
| PSModulePath. | ||
|
|
||
|
|
@@ -323,6 +327,10 @@ You can add also add a command that changes the value to your profile or use | |
| System in Control Panel to change the value of the `PSModulePath` environment | ||
| variable in the registry. | ||
|
|
||
| When starting Windows PowerShell or PowerShell ISE, PowerShell will remove the | ||
|
Contributor
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. When starting Windows PowerShell or PowerShell ISE, PowerShell removes the Remove future tense |
||
| version specific user module path, shared module path, and $PSHOME module path | ||
| from `PSModulePath` given to the child process. | ||
|
|
||
| For more information, see [about_Modules](about_Modules.md). | ||
|
|
||
| ## SEE ALSO | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PowerShell prefixes the user module path....
Remove future tense.