Steps to reproduce
> $env:PSModulePath -split ';'
C:\Users\roholt\Documents\PowerShell\Modules
C:\Program Files\PowerShell\Modules
c:\program files\powershell\6-preview\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
> & "$PSHOME\pwsh.exe"
> $env:PSModulePath -split ';'
C:\Users\roholt\Documents\PowerShell\Modules
C:\Program Files\PowerShell\Modules
c:\program files\powershell\6-preview\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
> & "PSHOME\pwsh.exe"
> $env:PSModulePath -split ';'
C:\Users\roholt\Documents\PowerShell\Modules
C:\Program Files\PowerShell\Modules
c:\program files\powershell\6-preview\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
> exit
> $env:PSModulePath -split ';'
C:\Users\roholt\Documents\PowerShell\Modules
C:\Program Files\PowerShell\Modules
c:\program files\powershell\6-preview\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
> exit
> $env:PSModulePath -split ';'
C:\Users\roholt\Documents\PowerShell\Modules
C:\Program Files\PowerShell\Modules
c:\program files\powershell\6-preview\Modules
C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
Expected behavior
System32 module paths don't build up.
Actual behavior
System32 module paths keep getting tacked onto the end of the the PSModulePath.
Pros:
- You always know how many PowerShells deep you are
Cons:
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.1.0-preview.4
PSEdition Core
GitCommitId 6.1.0-preview.4
OS Microsoft Windows 10.0.18200
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Steps to reproduce
Expected behavior
System32 module paths don't build up.
Actual behavior
System32 module paths keep getting tacked onto the end of the the PSModulePath.
Pros:
Cons:
Environment data