@@ -4764,16 +4764,13 @@ private static List<CompletionResult> GetDefaultProviderResults(
4764
4764
// Save relevant info and try again to get just the names.
4765
4765
foreach ( dynamic child in childItemOutput )
4766
4766
{
4767
- // TryAdd is used because some providers (like SCCM) may include duplicate PSPaths in a container.
4768
- _ = childrenInfoTable . TryAdd ( GetChildNameFromPsObject ( child , provider . ItemSeparator ) , child . PSIsContainer ) ;
4767
+ childrenInfoTable . Add ( GetChildNameFromPsObject ( child , provider . ItemSeparator ) , child . PSIsContainer ) ;
4769
4768
}
4770
4769
4771
4770
_ = context . Helper . CurrentPowerShell
4772
4771
. AddCommandWithPreferenceSetting ( "Microsoft.PowerShell.Management\\ Get-ChildItem" )
4773
4772
. AddParameter ( "LiteralPath" , pathInfo . Path )
4774
- . AddParameter ( "Name" )
4775
- . AddCommandWithPreferenceSetting ( "Microsoft.PowerShell.Utility\\ Sort-Object" )
4776
- . AddParameter ( "Unique" ) ;
4773
+ . AddParameter ( "Name" ) ;
4777
4774
childItemOutput = context . Helper . ExecuteCurrentPowerShell ( out _ ) ;
4778
4775
foreach ( PSObject child in childItemOutput )
4779
4776
{
@@ -4786,12 +4783,8 @@ private static List<CompletionResult> GetDefaultProviderResults(
4786
4783
foreach ( dynamic child in childItemOutput )
4787
4784
{
4788
4785
var childName = GetChildNameFromPsObject ( child , provider . ItemSeparator ) ;
4789
-
4790
- // TryAdd is used because some providers (like SCCM) may include duplicate PSPaths in a container.
4791
- if ( childrenInfoTable . TryAdd ( childName , child . PSIsContainer ) )
4792
- {
4793
- childNameList . Add ( childName ) ;
4794
- }
4786
+ childrenInfoTable . Add ( childName , child . PSIsContainer ) ;
4787
+ childNameList . Add ( childName ) ;
4795
4788
}
4796
4789
}
4797
4790
0 commit comments