Skip to content

Foreach loop using | % {} syntax doesn't support continue #3879

@rdbartram

Description

@rdbartram

Steps to reproduce

@("1","2","3") | % { if($_ -ne "2") { continue }; $_ }

This happens in both PS Core and Win PS

Expected behavior

2 Should be output as it would if written so.
foreach($item in @("1","2","3")) { if($item -ne "2") { continue }; $item }

Actual behavior

Nothing is output

Environment data

PSVersion 6.0.0-beta
PSEdition Core
BuildVersion 3.0.0.0
CLRVersion
GitCommitId v6.0.0-beta.1
OS Microsoft Windows 10.0.15063
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-No ActivityIssue has had no activity for 6 months or moreWG-Languageparser, language semantics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions