Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8164583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:21:00+00:00 2026-06-06T19:21:00+00:00

I am having a xml file similar to below. <Parameters> <Parameter IsEncrypted=False> <ParameterName>pRdGpInstallOptions</ParameterName> <ParameterValue>Custom</ParameterValue>

  • 0

I am having a xml file similar to below.

<Parameters>
  <Parameter IsEncrypted="False">
    <ParameterName>pRdGpInstallOptions</ParameterName>
    <ParameterValue>Custom</ParameterValue>
  </Parameter>
  <Parameter IsEncrypted="False">
    <ParameterName>pRdAccept</ParameterName>
    <ParameterValue>true</ParameterValue>
  </Parameter>
  <Parameter IsEncrypted="False">
    <ParameterName>pCboEditSQLServer</ParameterName>
    <ParameterValue>MachineName\SQLEXPRESS</ParameterValue>
  </Parameter>
</Parameters>

I have copied only few nodes here. Actually the real file may be having hundreds of Parameter nodes.

We can’t hard code the index as it may appear in any order. I am trying to retrieve SQLinstance name parameter value which is associated with Parameter Name "pCboEditSQLServer".

I would like to retrieve this value using powershell. How to parse this dynamic xml files?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:21:01+00:00Added an answer on June 6, 2026 at 7:21 pm
    $sql = $xml.Parameters.Parameter | Where-Object {$_.ParameterName -eq 'pCboEditSQLServer'}
    $sql.ParameterValue
    
    MachineName\SQLEXPRESS  
    

    Here’s another option (should be faster) using xpath:

    $path = "/Parameters/Parameter[ParameterName='pCboEditSQLServer']/ParameterValue"
    $xml.SelectSingleNode($path).'#text'
    

    And there’s the Select-Xml cmdlet:

    $sql = $xml | Select-Xml -XPath $path 
    $sql.Node.'#text'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an xml file in the below format: <Query> <map> <value name=val1>1</value> <value
Friends, My school project is having an xml data file: <patients> <patient> <regNo>2012/Mar/003</regNo> <name>Jhon</name>
I'm having trouble editing an XML file. I'm currently trying to use Nokogiri ,
I'm having trouble understanding why I would use a context.xml file to declare a
I'm having trouble with some data I've imported from an XML file. Unfortunately I'm
I'm using DOM to parse an xml file. And I am having trouble catching
I am having Msbuild XML file like this. <?xml version=1.0 encoding=utf-8?> <Project xmlns=schemas.microsoft.com/developer/msbuild/2003> <ItemGroup>
I'm having an xml file like <Root> <Child val1=1 Val2=0/> <Child val1=1 Val2=2/> <Child
I asked yersterday this question. Now I am having problem with the similar XML
I am having a xml file as: <Order> <EP> <Name>Generation Date</Name> <Value>2009-08-04+05:30</Value> </EP> <EP>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.