Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Pipeline stops enumerating on encountering a second AutomationNull value in the input #14920

Copy link
Copy link
@mklement0

Description

@mklement0
Issue body actions

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 # OK

Environment data

PowerShell Core 7.2.0-preview.3
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.