Q. Why would I use PowerShell's CliXML format instead of CSV?

Comma-separated value (CSV) files offer a simple, flat way to represent an object in text. They're also easily imported into other tools, like Microsoft Access or Microsoft Excel. They don't, however, do a good job of representing hierarchical data.

Don Jones

August 11, 2010

1 Min Read
feather and stone balanced on another stone

Q. Why would I use PowerShell's CliXML format instead of CSV?

A. Comma-separated value (CSV) files offer a simple, flat way to represent an object in text. They're also easily imported into other tools, like Microsoft Access or Microsoft Excel. They don't, however, do a good job of representing hierarchical data. For example, if you run the command

Get-Service | Export-CSV services.csv

open the services.csv file in Excel, and look at the DependentServices column, you'll see what I mean. XML, however, is excellent at representing hierarchical data:

Get-Service | Export-CliXML services.xml

The resulting file is somewhat harder to read for a human, but try opening it in Internet Explorer and you'll see what I mean.

Do you have a Windows PowerShell question? Find more PowerShell FAQs, articles, and other resources at windowsitpro.com/go/DonJonesPowerShell.

 

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like