Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static class HostUtilities
[System.Diagnostics.DebuggerHidden()]
param([string] $formatString)

$formatString -f [string]::Join(', ', (Get-Command $lastError.TargetObject -UseFuzzyMatch | Select-Object -First 10 -ExpandProperty Name))
$formatString -f [string]::Join(', ', (Get-Command $lastError.TargetObject -UseFuzzyMatch | Select-Object -First 10 -Unique -ExpandProperty Name))
";

private static ArrayList s_suggestions = new ArrayList(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

Describe "Get-Command CI tests" -Tag Feature {
Describe "Get-Command Feature tests" -Tag Feature {
Context "-UseFuzzyMatch tests" {
It "Should match cmdlets" {
$cmds = Get-Command get-hlp -UseFuzzyMatch
Expand All @@ -10,14 +10,15 @@ Describe "Get-Command CI tests" -Tag Feature {
}

It "Should match native commands" {
$ping = "ping"
$input = "pwsg"
$expectedcmd = "pwsh"
if ($IsWindows) {
$ping = "PING.EXE"
$expectedcmd = "pwsh.EXE"
}

$cmds = Get-Command pinh -UseFuzzyMatch
$cmds = Get-Command $input -UseFuzzyMatch
$cmds.Count | Should -BeGreaterThan 0
$cmds.Name | Should -Contain $ping
$cmds.Name | Should -Contain $expectedcmd
}
}

Expand Down