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

  1. 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:

  1. 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.