title: "Group by day" in PowerShell
body: <p>Ok I have this script where I read in a CSV (converted from a XLS) and save an ID-field as well as a date-field into an array. Like so:</p>
  
  <pre><code>New-Object PSObject -prop @{
      TheId = $_."The ID";
      TheDate = [DateTime]::Parse($_."The Date")
  }
  </code></pre>
  
  <p>It works like a charm and I get a nice array of objects with the two properties above. Now, I would like to get the count of items on each day, without having to do a <code>foreach</code> to loop through and such. Is there a nicer solution to it? (Note that <code>TheDate</code> contains different times too, which I'd like to ignore.)</p>