title: Powershell: How to use Format-Table with XML data
body: <pre><code>&lt;tickets type="array"&gt;
      &lt;ticket&gt;
          &lt;assigned-user-id type="integer"&gt;123&lt;/assigned-user-id&gt;
          &lt;closed type="boolean"&gt;true&lt;/closed&gt;
          &lt;creator-id type="integer"&gt;177522&lt;/creator-id&gt;
          &lt;number type="integer"&gt;306&lt;/number&gt;
          &lt;state&gt;resolved&lt;/state&gt;
          &lt;tag nil="true"/&gt;
          &lt;title&gt;
          title text 1
          &lt;/title&gt;
          &lt;updated-at type="datetime"&gt;2012-03-14T13:13:11+11:00&lt;/updated-at&gt;
          &lt;user-id type="integer"&gt;96438&lt;/user-id&gt;
          &lt;version type="integer"&gt;3&lt;/version&gt;
          &lt;user-name&gt;Username&lt;/user-name&gt;
      &lt;/ticket&gt;
  &lt;/tickets&gt;
  </code></pre>
  
  <p>I am a Powershell newbie and find a question on xml and format-table. Given above xml file. If I run below script to display tickets in a table, the value of "number", "closed" could not be shown</p>
  
  <pre><code>$t = [xml](new-object system.net.webclient).downloadstring($xmlfilepath)
  $t.tickets.ticket | Format-Table -Property title, state, user-name, url, number, closed
  </code></pre>
  
  <p>Return:</p>
  
  <pre><code>title            state       user-name       number       closed                                      
  -----            -----       ---------       ------       ------                                
  title text 1     resolved    Username        number       closed   
  title text 2     resolved    Username        number       closed   
  </code></pre>
  
  <p>Is it the only way I have to use <code>foreach</code> and <code>selectSingleNode("ticket").get_InnerXml()</code> to get all the values?</p>
  
  <p>Thank you.</p>