Change MatchType for EnumerationOptions to be Win32 (#9529)
This commit is contained in:
parent
935e164a6d
commit
346ab8c9d4
|
@ -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
|
||||
};
|
||||
|
|
|
@ -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' {
|
||||
|
|
Loading…
Reference in a new issue