Strange behavior for PowerShell Length after ForEach method
In official document it's mentioned that Length is one alias for Count, however I found one case that they behave differently. Besides, if I replace ForEach method with ForEach-Object, the Length will emit 3. Can anyone explain this? > (1..3).ForEach({$_}).Length 1 1 1 > (1..3).ForEach({$_}).Count 3
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.