CHAPTER 2
Filtering and Iterating Your Data
IN THIS CHAPTER, YOU WILL LEARN TO:
- ADD CONDITIONAL LOGIC
Use Comparison and Logic Operators
Use the If/ElseIf/Else Statements
Use the Switch Statement
- FILTER YOUR DATA
Use the Where-Object Cmdlet
Use the Sort-Object Cmdlet
Use the Select-Object Cmdlet
- ITERATE THROUGH YOUR DATA
Use While Loops
Use Do While Loops
Use Do Until Loops
Use For Loops
Use Foreach Loops
Use the ForEach-Object Cmdlet
Once you've declared your variables and have received a result set from the various Windows PowerShell and SharePoint 2010 cmdlets, you will often need to perform some conditional logic based on the data, filter the data, or loop through the data to perform some additional operations. The constructs and cmdlets ...
Get Automating Microsoft® SharePoint® 2010 Administration with Windows PowerShell® 2.0 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.