header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
PowerShell and XML list elements
Last Post 12 Aug 2010 03:42 AM by Mihail Stacanov. 1 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
jamesscott11User is Offline
New Member
New Member
Posts:7
Avatar

--
12 Aug 2010 03:07 AM
    Hello All,

     I'm pretty new to Powershell and get the feeling this is extremely easy, however its been about 6 hours now trying to solve the following without success, can anybody help?

     All I would like to do is output a list of attributes, but not element names in an XML file, so if the XML was like so:

    (?xml version="1.0" encoding="utf-8"?)
    (violations)
      (violationInfo code="RobotsContentType" level="Error"/)
      (violationInfo code="AltMissing"
    level="Error"/)
    (/violations)

    The Powershell output would be like this:

    code
    level

    Any help would be appreciated, thanks in advance,

    James

    P.S. XML disappeared when posting, therefore have replaced larger and smaller than signs with brackets.

    Mihail StacanovUser is Offline
    New Member
    New Member
    Posts:15
    Avatar

    --
    12 Aug 2010 03:42 AM
    #if you import xml than that fields becomes a properties of objects
    #try import you xml and get-member it
    Import-Clixml d:\xml.xml | gm
    http://proproit.com
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer