Loading XML string with PowerShell

Viewed 55925

I have defined an XML string using

$str = "<a><b></b></a>"

Now I want to load it into a [xml] variable to be able to manipulate it's nodes etc. The row below results in an error...

$str = [xml]"<a><b></b></a>"

How do I do this?

3 Answers
Related