title: How to add a custom property to a PowerShell array?
body: <p>Say I have a PowerShell array <code>$Sessions = @()</code> which I am going to fill with PSCustomObjects. How can I add a custom property to the array itself? E.g. so I can have <code>$Sessions.Count</code> which is built-in and <code>$Sessions.Active</code> which I want to set to the active session count.</p>
  
  <p>I know that I can add properties to PSCustomObjects (in a dirty way) with</p>
  
  <pre><code>$MyCustomObject = "" | Select-Object Machine, UserName, SessionTime
  </code></pre>
  
  <p>but though doing so on an array would not result in the property being added.</p>
  
  <p>So how can I achieve my goal? Is there any way to create a custom array?</p>