-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
In most situations, the default behavior of Export-Csv is undesirable. Its usage as an object Import and Export is limited to begin with. What it is more commonly used for (in my experience, anyway) is to produce CSV files either to be parsed by other automated processes outside the PowerShell ecosystem or to be used in Excel as human parsable reports. The initial line with the type information is undesirable in those situations.
This is a common "gotcha" for PowerShell novices. It violates the Principle of least astonishment.
I'm curious how many profiles have this $PSDefaultParameterValues['Export-CSV:NoTypeInformation'] = $true. I know I have that in my work profile and at the top of so many scripts.
It's a minor annoyance and a breaking change, but I just don't think the default behavior is actually useful.
My tentative proposal is to leave -NoTypeInformation in for backwards compatibility but make it default and add a -IncludeTypeInformation switch to revert to legacy behavior per request.
This issue is for discussion, yays, nays, and possible alternatives for a proposed solution.