PowerShell
PowerShell copied to clipboard
`Get-Command -UseFuzzyMatching` output includes duplicates
Prerequisites
- [x] Write a descriptive title.
- [x] Make sure you are able to repro it on the latest released version
- [x] Search the existing issues.
- [x] Refer to the FAQ.
- [x] Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
Get-Command -Name Get-ChildItem -UseFuzzyMatching
# Or with -FuzzyMinimumDistance specified:
Get-Command -Name Get-ChildItem -UseFuzzyMatching -FuzzyMinimumDistance 5
Expected behavior
With either example command, only unique results are produced.
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet Get-ChildItem 7.0.0.0 Microsoft.PowerShell.Management
Cmdlet Get-Item 7.0.0.0 Microsoft.PowerShell.Management
Actual behavior
Duplicate results are produced by either example command.
CommandType Name Version Source
----------- ---- ------- ------
Cmdlet Get-ChildItem 7.0.0.0 Microsoft.PowerShell.Management
Cmdlet Get-ChildItem 7.0.0.0 Microsoft.PowerShell.Management
Cmdlet Get-ChildItem 7.0.0.0 Microsoft.PowerShell.Management
Cmdlet Get-Item 7.0.0.0 Microsoft.PowerShell.Management
Cmdlet Get-Item 7.0.0.0 Microsoft.PowerShell.Management
Cmdlet Get-Item 7.0.0.0 Microsoft.PowerShell.Management
Cursory testing shows that at most, two duplicate results are produced irrespective of the command or -FuzzyMinimumDistance (but sometimes it's one or zero duplicates).
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