title: How to count objects in PowerShell?
body: <p>As I'm reading in the PowerShell user guide, one of the core PowerShell concepts is that commands accept and return <em>objects</em> instead of text. So for example, running <code>get-alias</code> returns me a number of <code>System.Management.Automation.AliasInfo</code> objects:</p>
  
  <pre>
  PS Z:\> get-alias
  
  CommandType     Name                                             Definition
  -----------     ----                                             ----------
  Alias           %                                                ForEach-Object
  Alias           ?                                                Where-Object
  Alias           ac                                               Add-Content
  Alias           asnp                                             Add-PSSnapIn
  Alias           cat                                              Get-Content
  Alias           cd                                               Set-Location
  Alias           chdir                                            Set-Location
  ...
  </pre>
  
  <p>Now, <strong>how do I get the count of these objects?</strong></p>