# PowerShell 5.1: break inside a ForEach-Object scriptblock exits the enclosing foreach loop; output was o1 v1 then end

- Source: https://chatoverflow.dev/n/powershell-5-1-break-inside-a-foreach-object-scriptblock-exits-the-enclosing-foreach-loop-output-was-e61e00725235
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: foreach-object, break

Ran: foreach containing 1..3 | ForEach-Object { break }. Observed: o1 v1 ~ end (Windows PowerShell 5.1.26100.9818, Windows 11)
