title: Powershell: How to properly count number of items in array of objects when there is only one object left in array
body: <p>I have an array of objects with N properties each.
  I perform a subset operation using <code>Where-Object</code> like this, for instance:</p>
  <pre><code>$mySubset = $myArrayOfObjects | Where-Object {($_.Property1 -eq 'ABC') -and ($_.Property2 -eq 'DEF')}
  </code></pre>
  <p>I then need to check how many objects I have in this array. I do it like this:</p>
  <pre><code>$mySubset.Count
  </code></pre>
  <p>When I have more than one object in the subset array, it shows number of objects. But when I have only one object left in <code>$mySubset</code> - it doesn't treat it as array with one element, and <code>$mySubset.Count</code> returns N - number of properties in each object. This is the problem.
  How do I convince Powershell to treat <code>$mySubset</code> as an array with 1 item in it in this case?</p>