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
Import-Csv Should apply PSTypeNames uppon import when Type Information is present in the CSV #5134
The seemingly only useful way to use the Type Information currently added by default during Export-Csv would be to reapply the PSTypeNames to the PSCustomObjects. Currently, These Type names are currently prepended with CSV:. This means that exporting a simple PSObject to CSV and then re-importing would require 2 format definitions or add/set the PSTypeNames for the imported objects.
You could have My.Custom.Object as TypesNames[0] and CSV:My.Custom.Object as TypesNames[1] although I don't know if anyone actually depends on CSV:typename.
@PowerShell/powershell-committee reviewed this and ok with a small breaking change where we insert the desired typename in index 0 and add the CSV:typename as index 1.
Activity
SteveL-MSFT commentedon Nov 7, 2017
You could have
My.Custom.Objectas TypesNames[0] andCSV:My.Custom.Objectas TypesNames[1] although I don't know if anyone actually depends onCSV:typename.SteveL-MSFT commentedon Nov 8, 2017
@PowerShell/powershell-committee reviewed this and ok with a small breaking change where we insert the desired typename in index 0 and add the CSV:typename as index 1.
Add PSTypeName Support for Import-Csv and ConvertFrom-Csv (#5389)
Add PSTypeName Support for Import-Csv and ConvertFrom-Csv (PowerShell…