PowerShell: Test If Collection Contains a Value
💡 TIP: Operator names are case-insensitive.
-contains operator
-contains-
collection contains a value. case-insensitive.
$x = 1,2,3 $x -contains 3 # True $x = "A","B" $x -contains "a" # True $x = "A","B" $x -icontains "a" # True $x = "A","B" $x -ccontains "a" # False -icontains-
same as
-contains. -ccontains-
case-sensitive version of
-contains.
-notcontains-
negation of
-contains -inotcontains-
same as
-notcontains -cnotcontains-
case-sensitive version of
-notcontains
-in operator
-in-
similar to
-contains, but the operands are in reverse order.$x = 1,2,3 3 -in $x # True -notin-
value is not in a collection
-iin-
case-insensitive, same as
-in -inotin-
case-insensitive version of
-notin -cin-
case-sensitive, same as
-in -cnotin-
case-sensitive version of
-notin
PowerShell. Array
- PowerShell: Array
- PowerShell: Array Sub-Expression Operator, Collection to Array
- PowerShell: Array and Types
- PowerShell: Nested Array, Multi-Dimensional Array
- PowerShell: Array, Get Item
- PowerShell: Array, Set Item
- PowerShell: Test If Collection Contains a Value
- PowerShell: Join Array, Append
- PowerShell: Filter Array (Where-Object)
- PowerShell: Delete Array, Clear Array
- PowerShell: Array to String
- PowerShell: Array Methods
- PowerShell: Iterate Array