Summary
In this module, you've learned how to filter objects out of the pipeline by using the Where-Object cmdlet to specify various criteria. The following are the key takeaways:
- The PowerShell comparison operators are used to compare a particular property of an object to a value. They help inform PowerShell of the objects that need to be retained and those that need to be removed from the pipeline.
- The Where-Object command has basic and advanced forms of syntax. Both forms are defined by an extensive list of parameter sets—one for each comparison operator.
- The advanced syntax of Where-Object uses a filter script, which is a script block that contains the comparison and that you pass by using the -FilterScript parameter.
- Many PowerShell scripters use the mnemonic filter left to help them remember to do the correct thing when they're optimizing performance.