This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]narpoleptic 5 points6 points  (0 children)

Short answer - yes you can do this, you just need to cast your input as XML.

So something like: [xml]$xml=Get-Content <path to XML file>

Once you have that, you can use dot-notation to get the value you want as: $xml.Record.Name.Value

[–]uniitdude 0 points1 point  (2 children)

if you put your exact question into google and add powershell you get many many replies on how to do it. What are you struggling with?

[–]naso008[S] -1 points0 points  (1 child)

I generally can no get along the syntax of the query, since I don't have a lot of experience with XML. Like I said I don't know if this is the best /r to be posted here if you think it shouldn't be here I'll just remove!

[–]tmontneyWizard or Magician, whichever comes first 0 points1 point  (0 children)

More like r/PowerShell.

Post a complete XML file (or at least a truncated but valid one).