Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im trying to construct a powershell script that uses some XML. I have a XML document where I try to add some values with email addresses. The finished xml document should have this format: (I'm only showing the relevant part of the xml here)


SO, in powershell I try to do this as a test, which fails:

$newNumber = [xml] '<value>555-1215</value>'
$newNode = $Request2.ImportNode($newNumber.value, $true)

After some reading, I have figured out that if I do this, it suceeds:

$newNumber = [xml] '<value name="flubber">555-1215</value>'
$newNode = $Request2.ImportNode($newNumber.value, $true)

So, I am stuck. I'm starting to wonder if I should use another function instead of importnode when I have several keys with the same name but different values.

As you guys probably have figured out by now, i'm not an expert in xml. ANy help appreciated!

share|improve this question
You might have better luck getting an answer on – ThatGraemeGuy Aug 5 '09 at 8:47
up vote 0 down vote accepted

Solved this by using:

$newNode = $Request2.createelement("value")
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.