Reading XML

Welcome Forums General PowerShell Q&A Reading XML

This topic contains 1 reply, has 2 voices, and was last updated by

2 years ago.

  • Author
  • #63959

    Points: 12
    Rank: Member

    I have a simple XML file with the regular "header" and one root element containing multiple child elements where some contain values describing the host and some are empty. My problem is when I save my xml into a variable
    [xml]$xml = Get-Content host.xml
    $details = $

    I then try to extract the values for of the child elements like so
    $ – this works. But when I use my $details variable it doesn't.
    $details.serialNumber – this doesn't.
    What am I missing?

  • #64239

    Points: 1,311
    Helping Hand
    Rank: Community Hero

    This is strange,

    Which PS Version ?
    Can you post the content of xml or any test xml content where you face this issue.
    and are you getting any error ?


The topic ‘Reading XML’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort