As a PowerShell developer, I often need to format output in a specific way. One common requirement is using the Select-Object cmdlet without including the header in the output. If you’re working on a script that outputs data to a file or console, you might want to remove these headers. In this tutorial, I will explain everything about PowerShell Select-Object without header with examples.
PowerShell Select-Object
The Select-Object cmdlet in PowerShell is used to select specific properties of an object or set of objects. It includes headers in the output by default, which can sometimes clutter your data presentation.
Basic Usage of Select-Object
Let’s start with a basic example. Suppose we have a list of employees, and we want to select their first names and job titles:
$employees = @(
[PSCustomObject]@{FirstName='John'; LastName='Doe'; JobTitle='Manager'},
[PSCustomObject]@{FirstName='Jane'; LastName='Smith'; JobTitle='Developer'},
[PSCustomObject]@{FirstName='Michael'; LastName='Johnson'; JobTitle='Analyst'}
)
$employees | Select-Object FirstName, JobTitleThis will output:
FirstName JobTitle
--------- --------
John Manager
Jane Developer
Michael AnalystYou can even see the exact output in the screenshot below:

Check out PowerShell Copy-Item
PowerShell Select-Object Without Header
To remove the headers from the output, we can use the Format-Table cmdlet with the -HideTableHeaders parameter. This is particularly useful when you need a clean output without any headers.
Example: Removing Headers
Continuing with our employee example, here’s how you can remove the headers:
$employees = @(
[PSCustomObject]@{FirstName='John'; LastName='Doe'; JobTitle='Manager'},
[PSCustomObject]@{FirstName='Jane'; LastName='Smith'; JobTitle='Developer'},
[PSCustomObject]@{FirstName='Michael'; LastName='Johnson'; JobTitle='Analyst'}
)
$employees | Select-Object FirstName, JobTitle | Format-Table -HideTableHeadersThis will output:
John Manager
Jane Developer
Michael AnalystBy using Format-Table -HideTableHeaders, we can achieve a cleaner look for our data.
Here is the exact output in the screenshot below:

Check out PowerShell Write-Output
Export Data Without Headers
If you need to export your data to a file without headers, you can use the Export-Csv cmdlet with the -NoTypeInformation and -Encoding parameters. However, since Export-Csv doesn’t have a built-in way to remove headers, we need to get a bit creative.
Let me show you an example.
Example: Exporting to CSV
Here’s a way to export data to a CSV file without headers:
$employees = @(
[PSCustomObject]@{FirstName='John'; LastName='Doe'; JobTitle='Manager'},
[PSCustomObject]@{FirstName='Jane'; LastName='Smith'; JobTitle='Developer'},
[PSCustomObject]@{FirstName='Michael'; LastName='Johnson'; JobTitle='Analyst'}
)
$employees | Select-Object FirstName, JobTitle | Export-Csv -Path "C:\MyFolder\employees.csv" -NoTypeInformation -Encoding UTF8
# Remove the first line (header) from the CSV
(Get-Content -Path "C:\MyFolder\employees.csv" | Select-Object -Skip 1) | Set-Content -Path "C:\MyFolder\employees_no_header.csv"This script first exports the data to a CSV file and then removes the first line, which contains the headers, by using Select-Object -Skip 1.
Conclusion
In this tutorial, I explained how to remove headers from PowerShell output while working with Select-Object using Format-Table. Do let me know in the comments below if it helps.
You may also like:
- PowerShell Write-Host vs Write-Information
- PowerShell Select-Object -Unique
- PowerShell Select-Object -First
- How to Get All Properties of an Object in PowerShell
Bijay Kumar is an esteemed author and the mind behind PowerShellFAQs.com, where he shares his extensive knowledge and expertise in PowerShell, with a particular focus on SharePoint projects. Recognized for his contributions to the tech community, Bijay has been honored with the prestigious Microsoft MVP award. With over 15 years of experience in the software industry, he has a rich professional background, having worked with industry giants such as HP and TCS. His insights and guidance have made him a respected figure in the world of software development and administration. Read more.