Skip to content

Get-Command -CommandType isn't respected when -UseFuzzyMatching is specified #26592

@surfingoldelephant

Description

@surfingoldelephant

Prerequisites

Steps to reproduce

Call Get-Command with both -CommandType and -UseFuzzyMatching. Application is used in the example below, but any command type can be used.

Get-Command -Name pwsh -CommandType Application -UseFuzzyMatching

Expected behavior

The results include only objects which match the specified -CommandType.

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     pwsh.exe                                           7.5.0.0    C:\Program Files\PowerShell\7\pwsh.exe

Actual behavior

Other command types are included in the results.

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Alias           nwsn ->                                            2.0.0.0    PSWorkflow
Alias           gasm ->                                            0.0        ClassExplorer
Function        Task                                               4.9.0      psake
Alias           ncso ->                                            7.0.0.0    CimCmdlets
Alias           pumo ->                                            2.2.5      PowerShellGet
Alias           pfn ->                                             1.0.0.0    AppBackgroundTask
Alias           ncso ->                                            1.0.0.0    CimCmdlets
Application     pwsh.exe                                           7.5.0.0    C:\Program Files\PowerShell\7\pwsh.exe
[...]

Environment data

Name                           Value
----                           -----
PSVersion                      7.6.0-preview.5
PSEdition                      Core
GitCommitId                    7.6.0-preview.5
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0, 5.0, 5.1…}
PSRemotingProtocolVersion      2.4
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-BugIssue has been identified as a bug in the productWG-ReviewedA Working Group has reviewed this and made a recommendation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Reviewed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions