title: PowerShell to get attribute values from XML with multiple attributes
body: <p>The following XML file is one Object node of the output from the command Get-ClusterGroup run from a 2008 R2 Failover Cluster with PowerShell 2:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;Objects&gt;
    &lt;Object&gt;
      &lt;Property Name="Cluster"&gt;Cluster1&lt;/Property&gt;
      &lt;Property Name="IsCoreGroup"&gt;False&lt;/Property&gt;
      &lt;Property Name="OwnerNode"&gt;Node1&lt;/Property&gt;
      &lt;Property Name="State"&gt;Offline&lt;/Property&gt;
      &lt;Property Name="Name"&gt;SAP PL1&lt;/Property&gt;
      &lt;Property Name="Description" /&gt;
      &lt;Property Name="PersistentState"&gt;1&lt;/Property&gt;
      &lt;Property Name="FailoverThreshold"&gt;4294967295&lt;/Property&gt;
      &lt;Property Name="FailoverPeriod"&gt;6&lt;/Property&gt;
      &lt;Property Name="AutoFailbackType"&gt;1&lt;/Property&gt;
      &lt;Property Name="FailbackWindowStart"&gt;4294967295&lt;/Property&gt;
      &lt;Property Name="FailbackWindowEnd"&gt;4294967295&lt;/Property&gt;
      &lt;Property Name="Priority"&gt;1&lt;/Property&gt;
      &lt;Property Name="DefaultOwner"&gt;4294967295&lt;/Property&gt;
      &lt;Property Name="AntiAffinityClassNames" /&gt;
      &lt;Property Name="Id"&gt;a5ff557f-c81a-43aa-bdb9-e09d0a1103df&lt;/Property&gt;
    &lt;/Object&gt;
  &lt;/Objects&gt;
  </code></pre>
  
  <p>The full file has three more Object nodes similar to this. Two of those nodes have the value "False" in the "IsCoreGroup" attribute and the other two are "True". What I am trying to do is get the value of the "Name" property and other attributes from the Object nodes that have the value of "False" in the "IsCoreGroup" attribute.</p>
  
  <p>I have tried a number of ways to get this attribute but can't figure out how to drill down into the sibling attributes.</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>[xml]$file = get-content C:\Admin\ClusterGroups.xml
  $xmlProperties = $file.SelectNodes("/Objects/Object/Property")
  Foreach ($xmlProperty in $xmlProperties) {
      $strName = ($xmlProperty | Where-Object {$_.Name -eq "IsCoreGroup" }).InnerXml
      If ($strName -eq "False")
      {
      Echo $xmlProperty
      }
  }
  </code></pre>
  
  <p>This gives me the following:</p>
  
  <pre><code>Name                                      #text                                    
  ----                                      -----                                    
  IsCoreGroup                               False      
  </code></pre>
  
  <p>But I can't figure out how to get the sibling properties</p>
  
  <p>I tried backing up a level with:</p>
  
  <pre><code>[xml]$file = get-content C:\Admin\ClusterGroups.xml
  $xmlObjects = $file.SelectNodes("/Objects/Object")
  Foreach ($xmlObject in $xmlObjects) {
      $strCoreGroup = ($xmlObject | Where-Object {$_.Property.Name -eq "IsCoreGroup" }).InnerXml
      If ($strCoreGroup -eq "False")
      {
      Echo $xmlObject
      }
  }
  </code></pre>
  
  <p>But that's not getting me anywhere.</p>
  
  <p>Any help is greatly appreciated!</p>