I have a csv
TEST1.CSV
Users DHMS
----- ----
A 22/12/21 05:02:00
B 22/12/21 05:10:00
C 22/12/21 06:30:00
D 23/12/21 12:30:00
A 23/12/21 12:35:00
B 23/12/21 12:45:00
C 26/12/21 10:32:00
D 28/12/21 11:15:00
A 29/12/21 14:17:00
B 29/12/21 14:25:00
I would like to add a column with the number of unique users
Users DHMS Count
----- ---- ----
A 22/12/21 05:02:00 3
B 22/12/21 05:10:00 3
C 22/12/21 06:30:00 2
D 23/12/21 12:30:00 2
A 23/12/21 12:35:00 3
B 23/12/21 12:45:00 3
C 26/12/21 10:32:00 2
D 28/12/21 11:15:00 2
A 29/12/21 14:17:00 3
B 29/12/21 14:25:00 3
I have the code for counting elements
$countusers = @{}
Import-Csv "$($path)\TEST1.csv" -DeLimiter ";" |
Group-Object Users| Select-Object Name,Count
$countusers
But I don't find how to add the third column count
A ForEach loop but how to assign value ?