I must be missing something here. I'm counting up a list, and want to skip over specific numbers, so I made a switch statement:
$locationNumber = 00
DO {
$locationNumber++
switch ($locationNumber) {
21 {$locationNumber++}
31 {$locationNumber++}
43 {$locationNumber++}
44 {$locationNumber++}
49 {$locationNumber++}
51 {$locationNumber++}
}
Write-Host $locationNumber
} while ($locationNumber -lt 53)
Here's the output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 32 33 34 35 36 37 38 39 40 41 42 44 45 46 47 48 50 52 53
Notice that 44 shows up, even though I have no breaks. Can someone tell me why/a way around this?
Thanks,
EDIT: Added more code for context