re: [msh] What is the '-Filter' param for on get-property, get-childit
- From: lee.holmes@xxxxxxxxxxxxxxxxxxxx
- Date: Thu, 23 Mar 2006 11:40:11 -0800
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?
.
- Prev by Date: Re: [MSH] Requires an executable on the RHS of a pipe?
- Next by Date: Re: [MSH] Requires an executable on the RHS of a pipe?
- Previous by thread: Re: Where user is logged on?
- Next by thread: First time scripter
- Index(es):
Relevant Pages
|