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.
Steps to reproduce
[PSCustomObject]@{
PSTypeName = 'My.Custom.Object'
Column1 = 'values1'
} | Export-Csv C:\temp\csv.csv
$import = Import-Csv C:\temp\csv.csv
$import.PSObject.TypeNames
Expected behavior
Actual behavior
Environment data
Name Value
---- -----
PSVersion 6.0.0-beta.8
PSEdition Core
GitCommitId v6.0.0-beta.8
OS Microsoft Windows 10.0.15063
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
The seemingly only useful way to use the Type Information currently added by default during
Export-Csvwould be to reapply the PSTypeNames to the PSCustomObjects. Currently, These Type names are currently prepended withCSV:. 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.Steps to reproduce
Expected behavior
Actual behavior
Environment data