The following example uses a do-while loop with a continue statement which displays the values from 10 to 20, excluding 15 and 18.
PS C:\> $a=10
PS C:\> do
>> {
>> if (($a -eq 15) ?or ($a -eq 18))
>> {
>> $a++
>> continue
>> }
>> echo $a
>> $a++
>> } while($a -le 20)
Output:10 11 12 13 14 16 17 19 20
Leave a Reply