filter parameter with the filesystem provider specifics?gci \ -filter *.ps1 -recurse<br/> <br/> where can I get the specifics on using filter parameter with the filesystem provider? For example I was expecting the above command to return all files ending in .ps1 but it also included files like SQLProvider.Types.ps1xml, clearly not ending in .ps1.© 2009 Microsoft Corporation. All rights reserved.Wed, 08 Jul 2009 15:13:46 Zff565341-c812-41d0-8330-3c97a76d05d0http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/ff565341-c812-41d0-8330-3c97a76d05d0#ff565341-c812-41d0-8330-3c97a76d05d0http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/ff565341-c812-41d0-8330-3c97a76d05d0#ff565341-c812-41d0-8330-3c97a76d05d0c0pehttp://social.technet.microsoft.com/Profile/en-US/?user=c0pefilter parameter with the filesystem provider specifics?gci \ -filter *.ps1 -recurse<br/> <br/> where can I get the specifics on using filter parameter with the filesystem provider? For example I was expecting the above command to return all files ending in .ps1 but it also included files like SQLProvider.Types.ps1xml, clearly not ending in .ps1.Thu, 02 Jul 2009 19:22:41 Z2009-07-02T19:22:41Zhttp://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/ff565341-c812-41d0-8330-3c97a76d05d0#e1073201-416f-4e59-96e7-ed90c6a4fbb6http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/ff565341-c812-41d0-8330-3c97a76d05d0#e1073201-416f-4e59-96e7-ed90c6a4fbb6Vadims Podanshttp://social.technet.microsoft.com/Profile/en-US/?user=Vadims%20Podansfilter parameter with the filesystem provider specifics?<p>if you want to list ps1 files in current folder only just type:<br/>dir *.ps1<br/>if you want to list ps1 files in current folder and subfolders use -Include parameter:<br/>dir -include *.ps1 -recurse</p><hr class="sig">[тут могла быть ваша реклама] http://www.sysadmins.lvThu, 02 Jul 2009 21:03:15 Z2009-07-02T21:03:15Zhttp://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/ff565341-c812-41d0-8330-3c97a76d05d0#31743b5d-4827-4b81-8dc2-7b9c27330fcbhttp://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/ff565341-c812-41d0-8330-3c97a76d05d0#31743b5d-4827-4b81-8dc2-7b9c27330fcbc0pehttp://social.technet.microsoft.com/Profile/en-US/?user=c0pefilter parameter with the filesystem provider specifics?Hi Vadims, thanks for the reply. I had tried the -include parameter first, which returned the expected results but very slowly... then I read a bit from 'man gci -full' where it recommended using the -filter parameter for performance reasons... the provider is supposed to do the filtering when using -filter and only return results whereas with -include the provider first returns all, then powershell filters by the -include criteria.... but the syntax for the -filter criteria is what I'm after (which is provider specific), because *.ps1 returns more than I expect, although more than twice as fast as -include.<br/>Thu, 02 Jul 2009 21:33:02 Z2009-07-02T21:33:02Zhttp://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/ff565341-c812-41d0-8330-3c97a76d05d0#9b1c361b-b9a2-4b50-87d1-41ff174dc272http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/ff565341-c812-41d0-8330-3c97a76d05d0#9b1c361b-b9a2-4b50-87d1-41ff174dc272Mervyn Zhanghttp://social.technet.microsoft.com/Profile/en-US/?user=Mervyn%20Zhangfilter parameter with the filesystem provider specifics?Hi,<br/> <br/> As a workaround, please try to test the following command. <br/> <br/> gci -filter *.ps1 | ? {$_.name -like &quot;*.ps1&quot;}<br/> <br/> Thanks. <br/><hr class="sig">This posting is provided &quot;AS IS&quot; with no warranties, and confers no rights.Fri, 03 Jul 2009 11:11:57 Z2009-07-03T11:11:57Zhttp://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/ff565341-c812-41d0-8330-3c97a76d05d0#f0445db5-8933-4dcb-b5b2-1f9dedc60f21http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/ff565341-c812-41d0-8330-3c97a76d05d0#f0445db5-8933-4dcb-b5b2-1f9dedc60f21c0pehttp://social.technet.microsoft.com/Profile/en-US/?user=c0pefilter parameter with the filesystem provider specifics?thanks Mervyn. That is a fine work-around and I appreciate that. What I am really hoping to find out though is what the specific semantics of the -filter switch are for the filesystem provider? <br/> <br/> For example:<br/> * = any number of characters (from my experience this doesn't work like the old DOS or CMD wildcard)<br/> ? = any one character<br/> others = ?<br/> is it using a regular expression syntax maybe?<br/> <br/> etc..<br/> <br/> anyone know where to get these specfics?Mon, 06 Jul 2009 15:04:11 Z2009-07-06T15:04:11Zhttp://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/ff565341-c812-41d0-8330-3c97a76d05d0#4acf676d-1a82-44ee-a823-a2f660bbfdb1http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/ff565341-c812-41d0-8330-3c97a76d05d0#4acf676d-1a82-44ee-a823-a2f660bbfdb1Mervyn Zhanghttp://social.technet.microsoft.com/Profile/en-US/?user=Mervyn%20Zhangfilter parameter with the filesystem provider specifics?Hi,<br/> <br/> Parameter accepts &lt;string&gt;, wildcards expression is available but Regular Expression cannot be used. Regarding wildcards please refer to the following article. <br/> Supporting Wildcards in Cmdlet Parameters<br/> http://msdn.microsoft.com/en-us/library/aa717088(VS.85).aspx<br/> <br/> Regular Expression can be used only when parameter accept &lt;string[]&gt;, such as &quot;select-string –pattern&quot;<br/> <br/> However, you reminded me, the result of &quot;gci –filter ? or multiple ?.ps1&quot; is different from &quot;&quot;gci –filter *.ps1&quot;. <br/> <br/> Thanks. <br/><hr class="sig">This posting is provided &quot;AS IS&quot; with no warranties, and confers no rights.Tue, 07 Jul 2009 03:59:09 Z2009-07-07T03:59:09Zhttp://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/ff565341-c812-41d0-8330-3c97a76d05d0#8b50e5dd-47eb-4acb-8ba6-9b25b426c4a6http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/ff565341-c812-41d0-8330-3c97a76d05d0#8b50e5dd-47eb-4acb-8ba6-9b25b426c4a6c0pehttp://social.technet.microsoft.com/Profile/en-US/?user=c0pefilter parameter with the filesystem provider specifics?Hi, thanks for the info. I checked out http://msdn.microsoft.com/en-us/library/aa717088(VS.85).aspx for info on wildcard specifics. The description there matches what my understanding was, which would mean there is a bug, or, how the filesystem provider uses them is different... that article was not specific to the filesystem provider, or the -filter parameter of gci though, so I don't know.<br/> <br/> but according to that description:<br/> gci \ -filter *.ps1 -recurse<br/> should return only files that end in .ps1, but it also includes .ps1xml and presumably .ps1AnythingElse<br/> <br/> so is this a known bug? Or is it simply that the filesystem provider has specific 'filter' syntax for use with the -filter parameter of gci... the latter is what I would guess, considering the help page for gci mentions that: &quot;the syntax of the filter, including the use of wildcards, depends on the provider.&quot;<br/> <br/> so where is this provider-specific syntax?<br/>Wed, 08 Jul 2009 15:13:46 Z2009-07-08T15:13:46Z