Skip to content

Conversation

@dantraMSFT
Copy link
Contributor

Fix #7679

PR Summary

This change updates ModuleIntrinsics.GetModulePath to handle the case where the Windows PowerShell module path is already in the environment's PSModulePath or when launched from a different version of PowerShell.

Previously, GetModulePath would append $PSHOME\Modules to the PSModulePath after removing the path for the launching version without considering the Windows PowerShell module path. The result, was the Windows PowerShell modules were found first and loaded incompatible modules; such as the built-in modules.

The change detects the Windows PowerShell module path and inserts $PSHOME\Modules path before it. The new test simulates launching from a different version of pwsh that has already added the Windows PowerShell module path.

PR Checklist

Copy link
Collaborator

@rjmholt rjmholt left a comment

Choose a reason for hiding this comment

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

LGTM

@TravisEz13 TravisEz13 self-assigned this Sep 8, 2018
@TravisEz13 TravisEz13 merged commit 4683934 into PowerShell:master Sep 10, 2018
@dantraMSFT dantraMSFT deleted the dantra/issue7679 branch September 10, 2018 20:41
@SteveL-MSFT SteveL-MSFT added this to the 6.1.x-servicing milestone Sep 10, 2018
@TravisEz13 TravisEz13 removed this from the 6.1.x-servicing milestone Jul 5, 2019
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.

Using PowerShell Core RC-1 as an OpenSSH subsystem on windows breaks core module loading

5 participants