You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Module discovery cmdlets should be able to override PSCompatibleEdition #6992
Issue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.WG-DevEx-Portabilityauthoring cross-platform or cross-architecture modules, cmdlets, and scriptsWG-Enginecore PowerShell engine, interpreter, and runtime
Moving toward broader usage on Windows for PowerShell Core 6, we will need to honour the PSCompatibleEditions field of module manifests.
However, this field may be set conservatively or defaulted to a conservative value. As such we should allow a flag to allow the forced import of those modules for Get-Module [-ListAvailable] and Import-Module.
Ideally the name of this flag should be pithy, expressive about being a compatibility override behaviour, and dangerous-sounding so that users will understand that things may break as a result.
However, I think it's fine to overload semantics of -Force situationally, given that you wouldn't ordinarily use -Force unless you expected the module to have been imported already.
Issue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.WG-DevEx-Portabilityauthoring cross-platform or cross-architecture modules, cmdlets, and scriptsWG-Enginecore PowerShell engine, interpreter, and runtime
Activity
mklement0 commentedon Jun 4, 2018
-Forcemay actually work for this - though knowing what is being forced would have to be gleaned from the documentation.Get-Modulecurrently doesn't have a-Forceswitch.Import-Moduledoes, and there it forces reloading of the target module (wonderfully summed up as "Indicates that this cmdlet re-imports a module and its members, even if the module or its members have an access mode of read-only." in the docs).-Forcesituationally, given that you wouldn't ordinarily use-Forceunless you expected the module to have been imported already.rjmholt commentedon Jun 13, 2018
Tagging @PowerShell/powershell-committee for review
SteveL-MSFT commentedon Jun 15, 2018
See PowerShell/PowerShell-RFC#130