Break out of inner loop only in nested loop
You won't be able to use a named loop with ForEach-Object, but can do it using the ForEach keyword instead like so:
$OuterLoop = 1..10
$InnerLoop = 25..50
$OuterLoop | ForEach-Object {
Write-Verbose "[OuterLoop] $($_)" -Verbose
:inner
ForEach ($Item in $InnerLoop) {
Write-Verbose "[InnerLoop] $($Item)" -Verbose
If ($Item -eq 30) {
Write-Warning 'BREAKING INNER LOOP!'
BREAK inner
}
}
}
Now whenever it gets to 30 on each innerloop, it will break out to the outer loop and continue on.