Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Reference Table for Loop Behavior in Powershell
Loop Return Continue Break
Normal Expectation NextItem NextItem ExitLoop
.foreach{} NextItem ExitLoop ExitLoop
foreach ($y in $x) ExitLoop NextItem ExitLoop
for ($i;$i -lt 5;$i++) ExitLoop NextItem ExitLoop
Foreach-Object -InputObject @() NextItem NextItem NextItem
Switch ExitLoop ExitLoop ExitLoop
While ExitLoop NextItem ExitLoop
@dgoldman-msft

This comment has been minimized.

Copy link

@dgoldman-msft dgoldman-msft commented Jul 18, 2020

Love this! Great stuff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment