PowerShell: Retrieve a specific internal XML element

Posted by rursw1 on Stack Overflow See other posts from Stack Overflow or by rursw1
Published on 2010-05-26T08:45:21Z Indexed on 2010/05/26 9:11 UTC
Read the original article Hit count: 431

Filed under:
|
|

Hi,

I have an XML document with this structure:

<Fruits>
    <Fruit>
        <Code>1</Code>
        <Name>Apple</Name>
    </Fruit>
</Fruits>

What is the best way to get a <Fruit> element by its code (or any other field) in PowerShell 1 code? (Not XPath, as it is supported in PowerShell 2 only)

Thanks!

© Stack Overflow or respective owner

Related posts about Xml

Related posts about powershell