-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Regression: Get-ChildItem -File -Filter *. no longer finds extension-less files on Windows #9330
Copy link
Copy link
Closed
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.
Description
in Windows PowerShell and v6.1.3 you can match files that don't have a filename extension with provider filter -Filter *..
This doesn't work anymore.
Note that -Filter ultimately uses the underlying Windows API for wildcard matching, which has legacy quirks, including the ability to match extension-less filenames with *.; it is not the same wildcard language as PowerShell's own (and *. wouldn't work that way with, say, -Include).
Steps to reproduce
Run the following test on Windows:
Describe "Extension-less file filtering" {
It "-Filter *. finds extension-less files" -Skip:(!$IsWindows) {
'' > TestDrive:/foo
(Get-ChildItem -File -LiteralPath TestDrive:/ -Filter *.).Name | Should -Be foo
}
}Expected behavior
The test should pass.
Actual behavior
The test fails.
Environment data
PowerShell Core v6.2.0 (6.2.0) on Microsoft Windows 10 Pro (64-bit; Version 1803, OS Build: 17134.706)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.