[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

powershell write-xml line

Posted on 2013-11-20
1
Medium Priority
?
749 Views
Last Modified: 2013-11-20
I have to recreate an xml file to import into a program.  The line I am having problems recreating looks like this
<Type xmlns="http://www.microsoft.com/provisioning/EapCommon">11</Type>

I can write the element type and add the xmlns attrbuite but I don't know how to add the value and then close the element.  The closes I have gotten is

<Type xmlns="http://www.microsoft.com/provisioning/EapCommon"/>

using this code
$xmlWriter.WriteElementString('Type')                                    $XmlWriter.WriteAttributeString('xmlns',"http://www.microsoft.com/provisioning/EapCommon")

What do I need to do to get the lines to match

Thanks

Dan
0
Comment
Question by:DanDWolff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
DanDWolff earned 0 total points
ID: 39663096
Figured it out, thought I would post the code in case anybody else runs into this problem

$XmlWriter.WriteStartElement("Type")
$XmlWriter.WriteAttributeString('xmlns',"http://www.microsoft.com/provisioning/EapCommon")
$XmlWriter.WriteString("25")
$XmlWriter.WriteEndElement()

Open in new window

0

Featured Post

Q2 2017 - Latest Malware & Internet Attacks

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out our latest Quarterly Internet Security Report!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question