Skip to content

Windows PowerShell modules have a priority if WinCompat feature is enabled #11419

@iSazonov

Description

@iSazonov

If WinCompat feature is enabled and loaded a Windows PowerShell module ,cmdlets from the module have a priority over PowerShell Core cmdlets.
/cc @anmenaga

Steps to reproduce

Get-Date -UFormat "%s" was changed in PowerShell Core and we use this in follow demo.

image

Expected behavior

Get-Date from PowerShell Core is involved.

I'd expect that PowerShell Core cmdlets have a priority or it is better WinCompat feature exports only requested cmdlet which explicitly presents in a feature list. Perhaps we could do Enable/Disable-WindowsPowerShellCmdlet -Module <name> -Cmdlet <name>

Actual behavior

Get-Date from Windows PowerShell is involved.

Environment data

Name                           Value
----                           -----
PSVersion                      7.0.0-preview.6
PSEdition                      Core
GitCommitId                    7.0.0-preview.6-71-g36d3b3c0e45937d56650b2747effde94c20b42aa
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExperimentalExperimental FeatureIssue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions