Not sure if expected behaviour or bug: -hascount of 1 passes on null-values #2089
-
Inadvertantly passing in null/unassigned variables to Issue #1000 seems similar, but I'm not (purposely) using strong typing.
I see that since it's getting an (empty) collection is probably why it evaluates as true, but is this expected/wanted? This caused some of my tests to give me false passes, I guess I have to test each var |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's basically the same issue as #1000. PowerShell passes null elements through the pipeline. Until PowerShell lets us know more about the origin of the pipeline, I'm not sure if there's much that can be done. To properly identify this we'd have to drop pipeline input iirc. |
Beta Was this translation helpful? Give feedback.
It's basically the same issue as #1000. PowerShell passes null elements through the pipeline.
Should
supports pipeline input, but can't know if this was a null that should be ignored or a null element from a collection that it should count.Until PowerShell lets us know more about the origin of the pipeline, I'm not sure if there's much that can be done.
To properly identify this we'd have to drop pipeline input iirc.