-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add -NoHeader parameter to ConvertTo-Csv and Export-Csv cmdlets
#19108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
SteveL-MSFT
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
iSazonov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with minor comments.
test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Csv.Tests.ps1
Outdated
Show resolved
Hide resolved
test/powershell/Modules/Microsoft.PowerShell.Utility/Export-Csv.Tests.ps1
Outdated
Show resolved
Hide resolved
bb44693 to
0843a77
Compare
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
|
@ArmaanMcleod Please open new issue in Docs repository and add reference in the PR description (where |
@iSazonov Done 🙂 |
|
@ArmaanMcleod Thanks for your contribution! |
|
🎉 Handy links: |
PR Summary
Fixes #17527
Added
-NoHeadertoConvertTo-CsvandExport-Csvcmdlets.PR Context
Currently we have no easy way to export a CSV file without headers, but we have the ability to import CSV files with headers using
Import-Csv -Header.This change allows
ConvertTo-CsvandExport-Csvto export without headers. This simplifies scenarios where the user may not care about headers and removes need to manipulate the CSV to achieve a header less CSV.So instead of always having to skip the first row when writing to CSV:
You can now convert to CSV without headers using
ConvertTo-Csv -NoHeader:You can also choose to export without headers using
Export-Csv -NoHeader:Or import first, manipulate pipeline object to something else, then export again with no headers:
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.-NoHeaderparameter inConvertTo-CsvandExport-CsvUtility Cmdlets MicrosoftDocs/PowerShell-Docs#9809(which runs in a different PS Host).