xml and powershell

I wrote about the unix command-line utility xmllint there : extract xml from the command line

Let’s do the same exercice in Powershell

PS> gc foo.xml
  <emp no="1">
  <emp no="2">

Simply use [xml] datatype !

(([xml](GC foo.xml)).emplist.emp|Where{$_.no-eq"1"}).ename

Powershell rules!

Published by

Laurent Schneider

Oracle Certified Master

One thought on “xml and powershell”

Leave a Reply

Your email address will not be published.


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>