Filtering Where-Object where

suggest change

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

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Basic set operations:
* Filtering Where-Object where

Table Of Contents
1 Loops
8 Basic set operations
19 XML
22 Strings
25 Aliases
47 MongoDB
65 AWS S3