Link to home
Start Free TrialLog in
Avatar of whorsfall
whorsfallFlag for Australia

asked on

Problem with Select-XML in Powershell

Hi,

I am having trouble trying to select some XML notes under
in an xml file.

Basically I want to set a variable to be all the
MSI application objects.

I would like to be able select all of them into an array.

I am trying the following statement and it does not seem to work.

It seems my xpath might be wrong?

I have attached the XML file.

Any suggestions?

Thanks,
Ward

$xpath = "/GPO/Computer/ExtensionData"
[xml]$a = Get-Content .\ComputerExample.xml
$b = $a | Select-Xml -XPath $xpath

Open in new window

ComputerExample.xml
ASKER CERTIFIED SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of whorsfall

ASKER

Hi,

Thanks for your response. Do u know why the Xpath search failed?

Thanks,

Ward