Search notes:

PowerShell: -in operator

$value = 'bar'
if ($value -in 'foo', 'bar', 'baz') {
   write-host "$value is in array"
}

$value = 'xxx'
if ($value -notIn 'foo', 'bar', 'baz') {
   write-host "$value is not in array"
}
Github repository about-PowerShell, path: /language/operator/in/is-in-array.ps1

See also

-contains
operators

Index