Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Recipe A.9. XML

PowerShell supports XML as a native data type. To create an XML variable, cast a string to the [xml] type:

	$myXml = [xml] @"
	<AddressBook>
	   <Person contactType="Personal">
	      <Name>Lee</Name>
	      <Phone type="home">555-1212</Phone>
	      <Phone type="work">555-1213</Phone>
	   </Person>
	   <Person contactType="Business">
	      <Name>Ariel</Name>
	      <Phone>555-1234</Phone>
	   </Person>
	</AddressBook>
	"@


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial