Skip to content

Commit 2e2e597

Browse files
+ is-in-array.ps1
1 parent 0be056a commit 2e2e597

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
$value = 'bar'
2+
if ($value -in 'foo', 'bar', 'baz') {
3+
write-host "$value is in array"
4+
}
5+
6+
$value = 'xxx'
7+
if ($value -notIn 'foo', 'bar', 'baz') {
8+
write-host "$value is not in array"
9+
}

0 commit comments

Comments
 (0)