-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Export-Csv: -Append should be mutually exclusive with -NoHeader #25820
Copy link
Copy link
Closed
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-ReviewedA Working Group has reviewed this and made a recommendationA Working Group has reviewed this and made a recommendation
Metadata
Metadata
Assignees
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-ReviewedA Working Group has reviewed this and made a recommendationA Working Group has reviewed this and made a recommendation
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Reviewed
Prerequisites
Steps to reproduce
-NoHeaderis invariably implied when using-Append, assuming that the target file exists and contains data, which only succeeds if the existing data starts with a header row.However, if the target file doesn't exist yet or is an empty file,
-Append -NoHeadercreates the file without a header row, and that causes subsequent calls targeting the same with the same switches to fail.Expected behavior
A parameter-binding error that indicates that
-Appendand-NoHeaderare mutually exclusive.Actual behavior
That is, the combination of
-Appendand-NoHeaderwas accepted, and created a no-header CSV file in the first call, causing the second one to predictably fail.If backward compatibility is a concern, the alternative is to selectively and quietly ignore
-NoHeaderif combined with-Append, in case the target file happens to either not yet exist or happens to be empty (0bytes).Error details
Environment data
Visuals
No response