Skip to content

Draft of PSModulePath behavior in PS7 #233

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 6 commits into from
Feb 5, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions 1-Draft/RFCxxxx-PSModulePath.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,22 +135,12 @@ Change would be to use `$env:PSModulePath`, but prefix with `User` modules path

Note that Windows PowerShell here means both `powershell.exe` and `powershell_ise.exe`.

Copy process `$env:PSModulePath` as `PS7PSModulePath`:
Copy process `$env:PSModulePath` as `WinPSModulePath`:

- Remove PS7 `User` module path
- Remove PS7 `System` module path
- Remove PS7 `$PSHOME` module path

Get fresh `$env:PSModulePath` from `Machine` scope if exists, otherwise `User` scope
as `WinPSModulePath`.

If any of the Windows PowerShell path segments was removed in `PS7PSModulePath`, then
remove it from `WinPSModulePath`.

Any segments in `WinPSModulePath` that exists in `PS7PSModulePath` are removed from
`PS7PSModulePath`.

Append remainder of `PS7PSModulePath` to end of `WinPSModulePath`.
Use that `WinPSModulePath` when starting Windows PowerShell.

### Starting PowerShell 7 from Windows PowerShell
Expand Down