mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fix issue with incomplete results when completing paths with wildcards in non-filesystem providers (#24757)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user