Basically I just want to see if the variable (in this case $roomnumber) matches any of the targets I specify (in this case 1,2 and 3). Below is what I tried, and it doesn’t work.

$roomnumber = 1

if ($roomnumber -match ‘1’,‘2’,‘3’) {

write-output “works”

}

I know I could do the following:

$roomnumber = 1

if ($roomnumber -eq ‘1’ -or $roomnumber -eq ‘2’ -or $roomnumber -eq ‘3’) {

write-output “works”

}

But I was hoping there would be any easy way to ask from a list like:

if ($roomnumber -eq 1,13,563,12,2) {