Title: Pipeline stops enumerating on encountering a second AutomationNull value in the input · Issue #14920 · PowerShell/PowerShell · GitHub
Open Graph Title: Pipeline stops enumerating on encountering a second AutomationNull value in the input · Issue #14920 · PowerShell/PowerShell
X Title: Pipeline stops enumerating on encountering a second AutomationNull value in the input · Issue #14920 · PowerShell/PowerShell
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, $au...
Open Graph 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. $automati...
X Description: Steps to reproduce Note: (& {}) is used to produce AutomationNull, i.e. the [System.Management.Automation.Internal.AutomationNull]::Value singleton representing "no output" in PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/14920
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Pipeline stops enumerating on encountering a second AutomationNull value in the input","articleBody":"## Steps to reproduce\r\n\r\nNote: `(\u0026 {})` is used to produce AutomationNull, i.e. the `[System.Management.Automation.Internal.AutomationNull]::Value` singleton representing \"no output\" in PowerShell.\r\n\r\n```powershell\r\n$automationNull = \u0026 {}\r\n1, $automationNull, 2, $automationNull, 3, 4, 5 | ForEach-Object { $_ } | Should -Be (1..5)\r\n```\r\n\r\n## Expected behavior\r\n\r\nThe 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).\r\n\r\n## Actual behavior\r\n\r\nThe test fails, because enumeration unexpectedly _stops_ on encountering the _second_ non-AutomationNull value.\r\n\r\n```none\r\nExpected @(1, 2, 3, 4, 5), but got @(1, 2).\r\n```\r\n\r\nNote that using true `$null` values does _not_ exhibit the problem: the following test succeeds:\r\n\r\n```powershell\r\n1, $null, 2, $null, 3, 4, 5 | ForEach-Object { $_ } | Should -Be 1, $null, 2, $null, 3, 4, 5 # OK\r\n```\r\n\r\n## Environment data\r\n\r\n```none\r\nPowerShell Core 7.2.0-preview.3\r\n```\r\n","author":{"url":"https://github.com/mklement0","@type":"Person","name":"mklement0"},"datePublished":"2021-02-28T15:29:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/14920/PowerShell/issues/14920"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b18acf73-a5f4-12d4-df7a-9420275346fe |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E524:9BF44:6FC0F4:A02D45:6A54917E |
| html-safe-nonce | 904e6483ef0f7da2b3a31e4726956edb05a6ff2db74f4df46566bce2d1a3e322 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTI0OjlCRjQ0OjZGQzBGNDpBMDJENDU6NkE1NDkxN0UiLCJ2aXNpdG9yX2lkIjoiMTQ1NTI5NjA2MDI1MTczODQ5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 871db3286ece6be90a4320fba9ca49b45a4d957a8b6b6bec61b0b6991fc639b6 |
| hovercard-subject-tag | issue:818233547 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/14920/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d96fdfd0ba1e4ac500ae5551ea1af29f8920de67406fbdd68472c921532131ec/PowerShell/PowerShell/issues/14920 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d96fdfd0ba1e4ac500ae5551ea1af29f8920de67406fbdd68472c921532131ec/PowerShell/PowerShell/issues/14920 |
| og:image:alt | Steps to reproduce Note: (& {}) is used to produce AutomationNull, i.e. the [System.Management.Automation.Internal.AutomationNull]::Value singleton representing "no output" in PowerShell. $automati... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mklement0 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8cfff6384f62259baea531c7f58bc7040f8dd92 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width