I'm currently trying to locate all users in an exported database which are not disabled with PowerShell. I got a XML-file which is structured like this:
<database>
<table name="USERS">
<entry>
<cell name="ID">1</cell>
<cell name="LOGINNAME">admin</cell>
<cell name="ISDELETED">FALSE</cell>
<cell name="STATIC">TRUE</cell>
</entry>
<entry>
<cell name="ID">2</cell>
<cell name="LOGINNAME">admin2</cell>
<cell name="ISDELETED">TRUE</cell>
<cell name="STATIC">TRUE</cell>
</entry>
</table>
</database>
The problem is: The attributes inside are all named "name" and I want to select only the elements where ISDELETED=TRUE.
I tried it with XPath but I don't know how to get the text after I select the with [@name='ID']
[xml]$xml = Get-Content .\db.xml
$xml |Select-Xml "/database/table[@name='USERS']/entry/cell[@name='ID']" | foreach {$_}
Does anyone have an idea? :)