re: [msh] What is the '-Filter' param for on get-property, get-childit



For the FileSystem, the filter parameter is what you are used to in cmd.exe: *.txt, etc. The best documentation for that I can find is available from here, as the "SearchPattern": http://msdn2.microsoft.com/en-us/library/ms143316.aspx, although it ultimately relies on the support provided by the lowest-level API in Windows: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/findfirstfileex.asp

In a SQL provider, for example, it would probably be additions (in SQL):

SQL:\Database\CustomersTable > dir Customer[1-9] -filter "((City like "%Redmond%") AND (Country = "USA"))"

Allowing the provider to do the filtering is usually faster, sometimes less powerful, and inconsistent by design:

[C:\winnt\system32]
MSH:14 > measure-command { dir *.dll }


Days : 0
Hours : 0
Minutes : 0
Seconds : 2
Milliseconds : 267
Ticks : 22675532
TotalDays : 2.62448287037037E-05
TotalHours : 0.000629875888888889
TotalMinutes : 0.0377925533333333
TotalSeconds : 2.2675532
TotalMilliseconds : 2267.5532




[C:\winnt\system32]
MSH:15 > measure-command { dir -fi *.dll }


Days : 0
Hours : 0
Minutes : 0
Seconds : 0
Milliseconds : 532
Ticks : 5324730
TotalDays : 6.16288194444444E-06
TotalHours : 0.000147909166666667
TotalMinutes : 0.00887455
TotalSeconds : 0.532473
TotalMilliseconds : 532.473

--
Lee Holmes [MSFT]
Microsoft Command Shell Development
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.




-----Original Message-----
From: forestial
Posted At: Thursday, March 23, 2006 10:59 AM
Posted To: microsoft.public.windows.server.scripting
Conversation: [msh] What is the '-Filter' param for on get-property, get-childit
Subject: [msh] What is the '-Filter' param for on get-property, get-childit


Both the get-property and get-childitem cmdlets support a property -Filter.
What is the Filter for?

The help in both cases says "Specifies filter elements as required and
supported by providers." which is fair enough in the sense that it's
different per provider, but still doesn't reveal much. Where would I look
to find more information about this parameter?
.



Relevant Pages

  • Re: Help with configuring Connection Filtering - RBL - zen.spamhau
    ... provider that you want to match in this connection filter, ... Click Match Filter Rule to the Following Mask, ... Microsoft CSS Online Newsgroup Support ...
    (microsoft.public.windows.server.sbs)
  • Re: How to get tables/views/columns in ODBC (& OleDb)
    ... Understanding the Common Schema Collections ... (OLEDB/ODBC/ Microsoft .NET Framework Data Provider). ... and filter the outputs by ... Microsoft Online Community Support ...
    (microsoft.public.data.odbc)
  • Re: How to get tables/views/columns in ODBC (& OleDb)
    ... Understanding the Common Schema Collections ... (OLEDB/ODBC/ Microsoft .NET Framework Data Provider). ... and filter the outputs by ... Microsoft Online Community Support ...
    (microsoft.public.data.odbc)
  • Re: MembershipProvider, ADAM and userProxy
    ... private MembershipUser FindUser(DirectoryEntry containerEntry, string ... filter, SearchScope searchScope, bool retrieveSAMAccountName, out ... So I agree with you that building a custom provider would be a reasonable ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: MembershipProvider, ADAM and userProxy
    ... private MembershipUser FindUser(DirectoryEntry containerEntry, string ... filter, SearchScope searchScope, bool retrieveSAMAccountName, out ... So I agree with you that building a custom provider would be a reasonable ...
    (microsoft.public.dotnet.framework.aspnet.security)