O'Reilly logo

Automating Microsoft® SharePoint® 2010 Administration with Windows PowerShell® 2.0 by Shannon Bray, Gary Lapointe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Filter Your Data

When you are dealing with collections of data, it is often necessary to filter that data down to either a specific result or a trimmed result set that can be used for reporting purposes. Windows PowerShell provides three key cmdlets that facilitate filtering data, sorting data, and finally, selecting specific attributes of an object:

  • Where-Object
  • Sort-Object
  • Select-Object

Use the Where-Object Cmdlet

The Where-Object cmdlet, aliased as where and ?, is perhaps the most useful cmdlet of the three, particularly when working with SharePoint data. This cmdlet takes input from the pipeline and filters that input based on a conditional expression. The conditional expression is written using a script block. The parameters for the

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required