feather and stone balanced on another stone

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

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.

 

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish