Skip to content

Instantly share code, notes, and snippets.

@nazwadi
Created November 24, 2016 04:31
Show Gist options
  • Save nazwadi/39ab723d933a607aef2172d2168c9c86 to your computer and use it in GitHub Desktop.
Save nazwadi/39ab723d933a607aef2172d2168c9c86 to your computer and use it in GitHub Desktop.
Powershell Convert XML to CSV
[xml]$books = Get-Content .\books.xml
$books.library.book | % {$_.title}
$books.library.book | % {$_.title} | ? { $_ -match 'starfish' }
$books.library.book | Export-Csv "books.csv" -NoTypeInformation -Delimiter:"," -Encoding:UTF8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment