8000 Document ConvertTo-/Export-Csv Support for IDictionary input · Issue #5104 · MicrosoftDocs/PowerShell-Docs · GitHub
[go: up one dir, main page]

Skip to content
Document ConvertTo-/Export-Csv Support for IDictionary input #5104
@vexx32

Description

@vexx32

Documentation Issue

PR: PowerShell/PowerShell#11029

Current serialization of IDictionary objects via the CSV cmdlets is very much not useful, as most of the traditional properties can only be flattened to a typename string, so all the data in the dictionaries is lost and all IDictionary entries passed to the CSV cmdlets look more or less identical when serialized in this way.

The linked PR changes this behaviour to ignore standard properties on IDictionary objects, and instead serialize the values contained in the dictionary, using the keys as the property names. It will also allow instance properties (such as those applied with Add-Member) to be serialized along with the dictionary's keys and values, although dictionary entries take precedence. If there is a key with the same name as an instance property, the dictionary entry will always be used instead of the instance property.

All other behaviours of the CSV cmdlets are retained for IDictionary objects, including property discovery behaviour. Only property names/keys on the first input object are inspected, and all subsequent objects are assumed to have the same properties / keys.

Context of the issue

Detailed description of the issue

Further details are in the linked PR to the PowerShell repo.

Metadata

Metadata

Assignees

Labels

area-utilityArea - Microsoft.PowerShell.Utility module

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0