I've seen a number of scripts that look like this:
GET-XXXX | Where {$_.name -eq "foo"}
or
GET-XXXX | Where {$_.name -like "A*"}
Whenever you see code like this, it is a sign that the GET-XXXX is not designed correctly. (NOTE: GET-XXXX is NOT a porn retrieval cmdlet - it is a standin for any GET-<SOMETHING> cmdlet).
The whole point of a cmdlet is to think about the USER and deliver the correct experience. As a GENERAL rule, we encourage cmdlet developers to leverage PowerShell utilities like WHERE, SORT, FORMAT, etc and NOT to put that function into their cmdlets. The reason for this is that this makes the cmdlet more complicated and provides NEW semantics that the user has to learn.
There are a couple of exceptions to this general rule:
Cheers!
Jeffrey Snover [MSFT]Windows Management Partner ArchitectVisit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShellVisit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx