-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Unexpected Behavior of return in Switch Block #20739
Copy link
Copy link
Closed
Labels
7.4-regressionRegression in 7.4Regression in 7.4In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueNeeds-InvestigationThe behavior reported in the issue is unexpected and needs further investigation.The behavior reported in the issue is unexpected and needs further investigation.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtimeWG-NeedsReviewNeeds a review by the labeled Working GroupNeeds a review by the labeled Working Group
Metadata
Metadata
Assignees
Labels
7.4-regressionRegression in 7.4Regression in 7.4In-PRIndicates that a PR is out for the issueIndicates that a PR is out for the issueNeeds-InvestigationThe behavior reported in the issue is unexpected and needs further investigation.The behavior reported in the issue is unexpected and needs further investigation.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtimeWG-NeedsReviewNeeds a review by the labeled Working GroupNeeds a review by the labeled Working Group
Prerequisites
Steps to reproduce
Executing the following script in PowerShell 7.4.0 results in an unexpected behavior which also differs from PowerShell 5.1
PS 5.1 output:
PS 7.4.0 output:
It's not clear if this is a bug or simply a documente change from classic PowerShell, but it certainly behaves in a way I don't find intuitive.
Expected behavior
Actual behavior
Error details
No response
Environment data
Visuals
No response