diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index e58ee43f5..aee6c2e8b 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -85,6 +85,7 @@ namespace Microsoft.PowerShell.Commands private Collection _excludeMatcher = null; private static System.IO.EnumerationOptions _enumerationOptions = new System.IO.EnumerationOptions { + MatchType = MatchType.Win32, MatchCasing = MatchCasing.CaseInsensitive, AttributesToSkip = 0 // Default is to skip Hidden and System files, so we clear this to retain existing behavior }; diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 index 08607469e..6a1d791ed 100644 --- a/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 @@ -169,6 +169,11 @@ Describe "Get-ChildItem" -Tags "CI" { $file.Count | Should be 1 $file.Name | Should be "pagefile.sys" } + + It "-Filter *. finds extension-less files" { + $null = New-Item -Path TestDrive:/noextension -ItemType File + (Get-ChildItem -File -LiteralPath TestDrive:/ -Filter noext*.*).Name | Should -BeExactly 'noextension' + } } Context 'Env: Provider' {