title: Possible to get the count for the last command executed in PowerShell?
body: <p>I am writing a script where I would like to spit out a bunch of records and then display the count as the last line.  This is what I have so far:</p>
  
  <pre><code>Get-Whatever -Department $Deparment
  Write-Host (Get-Whatever -Department $Deparment).Count " records found"
  </code></pre>
  
  <p>But i'm curious if there is a way to do it without executing it twice.  I thought that I had read you could use <code>$$</code> somewhere but this isn't working.  Is there a better way to do this, or do I just have to run it twice?</p>
  
  <p>My Desired output would look something like this:</p>
  
  <pre><code>Name
  -------
  Abe
  Joe
  Bill
  
  3 records found
  </code></pre>