-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
Steps to reproduce
Note: (& {}) is used to produce AutomationNull, i.e. the [System.Management.Automation.Internal.AutomationNull]::Value singleton representing "no output" in PowerShell.
$automationNull = & {}
1, $automationNull, 2, $automationNull, 3, 4, 5 | ForEach-Object { $_ } | Should -Be (1..5)Expected behavior
The test should pass: all non-AutomationNull values should be passed through (while the AutomationNull values in the input are apparently themselves not sent through the pipeline).
Actual behavior
The test fails, because enumeration unexpectedly stops on encountering the second non-AutomationNull value.
Expected @(1, 2, 3, 4, 5), but got @(1, 2).
Note that using true $null values does not exhibit the problem: the following test succeeds:
1, $null, 2, $null, 3, 4, 5 | ForEach-Object { $_ } | Should -Be 1, $null, 2, $null, 3, 4, 5 # OKEnvironment data
PowerShell Core 7.2.0-preview.3
FatalBulletHit, badrelmers, noamper and iRon7FatalBulletHit
Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime