Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upOn launch, insert PSHOME\Modules into PSModulePath before the Windows PowerShell module path #7727
+39
−1
Conversation
dantraMSFT
requested review from
daxian-dbw,
rjmholt and
SteveL-MSFT
Sep 6, 2018
dantraMSFT
requested a review
from
BrucePay
as a
code owner
Sep 6, 2018
dantraMSFT
referenced this pull request
Sep 7, 2018
Closed
Using PowerShell Core RC-1 as an OpenSSH subsystem on windows breaks core module loading #7679
iSazonov
approved these changes
Sep 7, 2018
dantraMSFT
requested a review
from
TravisEz13
Sep 8, 2018
TravisEz13
self-assigned this
Sep 8, 2018
TravisEz13
merged commit 4683934
into
PowerShell:master
Sep 10, 2018
8 checks passed
CodeFactor
No issues found.
Details
PowerShell-CI-linux
#PR-7727-20180907.01 succeeded
Details
PowerShell-CI-macos
#PR-7727-20180907.01 succeeded
Details
PowerShell-CI-windows
#PR-7727-20180907.01 succeeded
Details
WIP
ready for review
Details
continuous-integration/appveyor/pr
AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
license/cla
All CLA requirements met.
Details
dantraMSFT
deleted the
dantraMSFT:dantra/issue7679
branch
Sep 10, 2018
SteveL-MSFT
added this to the 6.1.x-servicing milestone
Sep 10, 2018
iSazonov
referenced this pull request
Oct 18, 2018
Open
Import Microsoft.PowerShell.Management version 3.1 does not allow use of Write-EventLog #8026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
dantraMSFT commentedSep 6, 2018
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
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.[feature]if the change is significant or affects feature tests