-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Document -NoHeader parameter in ConvertTo-Csv and Export-Csv Utility Cmdlets #9809
Copy link
Copy link
Closed
Labels
area-utilityArea - Microsoft.PowerShell.Utility moduleArea - Microsoft.PowerShell.Utility moduleissue-doc-ideaIssue - request for new contentIssue - request for new content
Milestone
Description
Prerequisites
- Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
- Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Document new
Get-Foocmdlet" instead of "New cmdlet."
Summary
Added -NoHeader parameter to ConvertTo-Csv and Export-Csv cmdlets. This allows used to export CSV without headers much easier.
Details
Example ConvertTo-Csv Usage
PS C:\> $myObjects = @(
> [PSCustomObject]@{
> Name = 'John'
> LastName = 'Smith'
> }
> [PSCustomObject]@{
> Name = 'Freddy'
> LastName = 'Kruger'
> }
> )
PS C:\> $myObjects | ConvertTo-Csv -NoHeader | Out-File -FilePath 'output.csv'
PS C:\> cat 'output.csv'
"John","Smith"
"Freddy","Kruger"Example Export-Csv Usage
PS C:\> $myObjects | Export-Csv -Path 'output.csv' -NoHeader
PS C:\> cat 'output.csv'
"John","Smith"
"Freddy","Kruger"Can probably replace names or sample data if not appropriate 😄.
Articles
- reference/7.3/Microsoft.PowerShell.Utility/ConvertTo-Csv.md
- reference/7.3/Microsoft.PowerShell.Utility/Export-Csv.md
Related Source Pull Requests
Related Source Issues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-utilityArea - Microsoft.PowerShell.Utility moduleArea - Microsoft.PowerShell.Utility moduleissue-doc-ideaIssue - request for new contentIssue - request for new content