#1 24 Jan 2018 16:58

lousyd
Member
Registered: 03 Oct 2014
Posts: 5

Get-ChildItem's Filter Parameter in the FileSystem Provider

The page for PowerShell's Get-ChildItem cmdlet is here.

That page explains the "-Filter" parameter as "A filter in the provider's format or language." It might be helpful to add a few points:

According to Lee Holmes :

* "The value of this parameter qualifies the Path parameter."
* "In the Filesystem Provider’s case, the Win32 API (FindFirstFile) takes a pattern parameter that is then processed by the API itself. When you use wildcards in cmd.exe, file resolution and wildcarding is done directly by this Win32 API."

Or, as a StackOverflow answer puts it:

* "The Filter of FileSystem provider rather uses CMD wildcards than PowerShell wildcards."

The StackOverflow answer also has a link to some interesting stuff about how CMD wildcards got to be what they are.

Offline

#2 26 Jan 2018 13:39

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 976
Website

Re: Get-ChildItem's Filter Parameter in the FileSystem Provider

Thanks for the heads up about this, I have updated the Get-ChildItem page and the wildcards page with some notes about the differences.

Offline

Board footer

Powered by FluxBB