troubleshooting Question

parsing xml using powershell

Avatar of DevSupport
DevSupport asked on
XMLPowershell* Parsing
6 Comments1 Solution520 ViewsLast Modified:
Hi Experts,

I am parsing an xml file and I'm trying to get some values from it remotely.

Attached is the xml.

I can get the url from context file as follows:

$tchome = c:\app\location
$pointr = someuser2

$output = Invoke-Command -ComputerName appserver -ArgumentList ($tchome,$pointr) -ScriptBlock {Param($tchome, $pointr); $xmldata = [xml](Get-Content $tchome\conf\context.xml); ($xmldata.SelectSingleNode("//Resource[@username='$pointr']")).url}

Is there a way by which I can get $output as databasename - db2

I would also like to get the database name after // in this case DBServer2. Is it possible?

Thanks
DevSupport
context.xml
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros