If I do the following in a PowerShell script:
$range = 1..100 ForEach ($_ in $range) { if ($_ % 7 -ne 0 ) { continue; } Write-Host \"$($_) is a multi
Another alternative is kind of a hack, but you can wrap your block in a loop that will execute once. That way, continue will have the desired effect:
continue
1..100 | ForEach-Object { for ($cont=$true; $cont; $cont=$false) { if ($_ % 7 -ne 0 ) { continue; } Write-Host "$($_) is a multiple of 7" } }