Problem: Can’t pipe Format-Table to Export-CSV

I discovered a strange behavior (I thinking the reason is related to formatting objects that is added using Fromat-* cmdlet) piping Format-Table cmdlet to Export-CSV on Powershell.

The good news is that there’s really no reason to pipe Format-Table to Export-CSV.

That does not work:

Get-Service | Format-Table Name,DisplayName,Status | Export-CSV

..but you can have the same results by using Select-Object instead:

Get-Service | Select-Object Name,DisplayName,Status | Export-CSV
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s