Fix issue with incomplete results when completing paths with wildcards in non-filesystem providers (#24757)

This commit is contained in:
MartinGC94
2025-02-25 08:04:56 +05:00
committed by GitHub
parent 563892f673
commit a23e30bed3
2 changed files with 23 additions and 1 deletions
@@ -4869,7 +4869,7 @@ namespace System.Management.Automation
if (childNameList.Count == 0)
{
return results;
continue;
}
string basePath = providerPrefix.Length > 0
@@ -43,6 +43,28 @@ Describe "Tab completion bug fix" -Tags "CI" {
$result[0].CompletionText | Should -BeExactly '$ErrorActionPreference'
}
It "Issue#24756 - Wildcard completions should not return early due to missing results in one container" -Skip:(!$IsWindows) {
try
{
$keys = New-Item -Path @(
'HKCU:\AB1'
'HKCU:\AB2'
'HKCU:\AB2\Test'
)
$res = TabExpansion2 -inputScript 'Get-ChildItem -Path HKCU:\AB?\'
$res.CompletionMatches.Count | Should -Be 1
$res.CompletionMatches[0].CompletionText | Should -BeExactly "HKCU:\AB2\Test"
}
finally
{
if ($keys)
{
Remove-Item -Path HKCU:\AB? -Recurse -ErrorAction SilentlyContinue
}
}
}
Context "Issue#3416 - 'Select-Object'" {
BeforeAll {
$DatetimeProperties = @((Get-Date).psobject.baseobject.psobject.properties) | Sort-Object -Property Name