You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Export-Csv -InputObject and ConvertTo-Csv -InputObject export/convert the collection object itself rather than its elements #3865
PowerShell Core v6.0.0-beta (v6.0.0-beta.1) on macOS 10.12.5
PowerShell Core v6.0.0-beta (v6.0.0-beta.1) on Ubuntu 16.04.1 LTS
PowerShell Core v6.0.0-beta (v6.0.0-beta.1) on Microsoft Windows 10 Pro (64-bit; v10.0.14393)
Windows PowerShell v5.1.14393.1198 on Microsoft Windows 10 Pro (64-bit; v10.0.14393)
This is how ValueFromPipeline works by design. InputObject is a single object to be processed. When used in a pipeline, InputObject is bound to each element in the pipeline and processed one at a time. If InputObject was processed as a collection, then each item from the pipeline would also be processed as a collection.
My misconception was that only select cmdlets such as Get-Member made this distinction, because of their specific purpose.
I know understand that all cmdlets are affected, which means we have a bigger usability and/or documentation problem on our hands - I'll address that in a new issue.
Activity
BrucePay commentedon May 25, 2017
This is how ValueFromPipeline works by design. InputObject is a single object to be processed. When used in a pipeline, InputObject is bound to each element in the pipeline and processed one at a time. If InputObject was processed as a collection, then each item from the pipeline would also be processed as a collection.
mklement0 commentedon May 25, 2017
Thanks for the clarification, Bruce Payette (@BrucePay).
My misconception was that only select cmdlets such as
Get-Membermade this distinction, because of their specific purpose.I know understand that all cmdlets are affected, which means we have a bigger usability and/or documentation problem on our hands - I'll address that in a new issue.