My code looks like:
1..10 | % {
$i=$_
10..20 | % {
if ($_ -gt 12) {
continue
}
Write-Host $i $_
}
}
Why the output is:
1 10
1 11
1 12
It seems the continue
statement in PoweShell is not different with other language, why PowerShell is designed like this?
If I change the continue
to return
, then I get the expect result.