Change MatchType for EnumerationOptions to be Win32 (#9529)

This commit is contained in:
Steve Lee 2019-05-06 17:20:08 -07:00 committed by Aditya Patwardhan
parent 935e164a6d
commit 346ab8c9d4
2 changed files with 6 additions and 0 deletions

View file

@ -85,6 +85,7 @@ namespace Microsoft.PowerShell.Commands
private Collection<WildcardPattern> _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
};

View file

@ -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' {