-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Add WinCompat deny list support using a setting in powershell.config.json #11726
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
Add WinCompat deny list support using a setting in powershell.config.json #11726
Conversation
src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1
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
Is this needed for GA? |
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
@PoshChan Please remind me in 1 day |
|
@PaulHigin Can you update your review? |
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
Please resolve conflicts |
@TravisEz13, this is the reminder you requested 1 day ago |
My earlier comment may have gotten buried - the WSUS module should be added to the WInCompat deny list. |
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.
Pending adding UpdateServices
module to the list
@SteveL-MSFT Please update your review? |
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
@PoshChan Please remind me in 1 hour |
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.
One NIT
test/powershell/Modules/Microsoft.PowerShell.Core/CompatiblePSEditions.Module.Tests.ps1
Outdated
Show resolved
Hide resolved
@TravisEz13, this is the reminder you requested 1 hour ago |
@PoshChan Please remind me in 1 hour |
@TravisEz13, this is the reminder you requested 1 hour ago |
…rShell#11726) # Conflicts: # build.psm1 # src/System.Management.Automation/engine/Modules/ImportModuleCommand.cs
🎉 Handy links: |
PR Summary
Some Windows PowerShell modules don't work well with de/serialized objects, so they can not be used with WinCompat.
This PR adds support for an optional
WindowsPowerShellCompatibilityModuleDenyList
setting (a string array) inpowershell.config.json
so that a user can prevent specified modules from being loaded using WinCompat.If WinCompat feature is enabled and it tries to load a module mentioned in the DenyList, then an error is generated.
Module name comparison is case-insensitive.
By default, in PowerShell packages for Windows OS, this setting will contain
PSScheduledJob
,BestPractices
andUpdateServices
modules (this list most likely will be extended in future).Fix #11687
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.