-
Notifications
You must be signed in to change notification settings - Fork 7.6k
NoClobber WinCompat module import #12269
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
Conversation
Do we want to have the fix as servicing one for 7.0 LTS? |
@PoshChan please retry windows |
@daxian-dbw, successfully started retry of |
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.
Generally looks good, but I think there are some cases with module specifications that need dealing with. Also left some style comments
src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1
Show resolved
Hide resolved
src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs
Outdated
Show resolved
Hide resolved
@PoshChan please retry windows |
@anmenaga, successfully started retry of |
🎉 Handy links: |
🎉 Handy links: |
PR Summary
Fix #11419
This addresses an issue where Windows PowerShell proxy modules have a priority over PS Core modules during WinCompat module import. (see #11419 )
PR Context
Implicit PS Remoting code (reused by WinCompat) is doing
Export-PSSession -AllowClobber
.The fix is to omit
-AllowClobber
parameter if WinCompat:engine modules
:powershell.config.json
inWindowsPowerShellCompatibilityNoClobberModuleList
list. (this list is empty by default)If a module falls into one of these buckets, then PS-Core version of the module is imported first (for
engine modules
from$PSHOME\Modules
), then proxies are generated for WinPS version of the module without-AllowClobber
flag. This result s in proxy modules not having PS Core commands.Fix #11419
Fix #12014
Also fixed a bug where WinCompat module DenyList was not working for module names containing dots
.
in some cases.PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.