February 2019
Intermediate to advanced
626 pages
15h 51m
English
XPath can be used to navigate or search an XML document. PowerShell (and .NET) uses XPath 1.0.
Terms and values used in XPath queries, and XML in general, are case-sensitive.
Given the following XML snippet, Select-Xml might use an XPath expression to select the engines of green cars:
$string = @"
<?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>
"@
The -XPath expression ...
Read now
Unlock full access