-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Breaking-Changebreaking change that may affect usersbreaking change that may affect usersCommittee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Description
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.TypeNamesExpected behavior
My.Custom.Object
Actual behavior
CSV:My.Custom.Object
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
LeeDailey
Metadata
Metadata
Assignees
Labels
Breaking-Changebreaking change that may affect usersbreaking change that may affect usersCommittee-ReviewedPS-Committee has reviewed this and made a decisionPS-Committee has reviewed this and made a decisionIssue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module