Opening documents

The XDocument class is used to load or parse a document. XML content may be cast to an XDocument in the same way that content is cast using the [Xml] type accelerator:

[System.Xml.Linq.XDocument]$xDocument = @" 
<?xml version="1.0"?> 
<cars> 
    <car type="Saloon"> 
        <colour>Green</colour> 
        <doors>4</doors> 
        <transmission>Automatic</transmission> 
        <engine> 
            <size>2.0</size> 
            <cylinders>4</cylinders> 
        </engine> 
    </car> 
</cars> 
"@ 
$xDocument.Save("$pwdcars.xml") 

If the content has been saved to a file, the Load method may be used with a filename:

$xDocument = [System.Xml.Linq.XDocument]::Load("$pwdcars.xml") 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.171.235