Filter an enumeration by using a conditional expression
Synonyms:
Where-Object
where
?
Example:
$names = @( "Aaron", "Albert", "Alphonse","Bernie", "Charlie", "Danny", "Ernie", "Frank")
$names | Where-Object { $_ -like "A*" }
$names | where { $_ -like "A*" }
$names | ? { $_ -like "A*" }
Returns:
Aaron
Albert
Alphonse