This is a vbScript code fragment for something which took me a little too long to figure out. I am looking at a single dimension array and need to get a count of items in the array which are duplicates. I am comfortable with using the dictionary object and it seemed to be easier than using a recordset or a multidimensional array. So if your net search found this page, check out DisplayArrayDupeCount.vbs.
Update: 8/3/2019: The PowerShell equivalent is this:
$aDates = @("2/11/2013 11:10","2/11/2013 11:10","2/10/2013 10:59","2/11/2013 11:10",` "2/11/2013 11:10","11/13/2012 12:52","2/11/2013 11:10","2/11/2013 11:10","2/11/2013 11:10",` "2/8/2013 21:23","2/11/2013 11:10","11/13/2012 12:29","2/11/2013 16:51","2/11/2013 11:10",` "2/11/2013 11:10","2/11/2013 11:10","2/10/2013 10:59","11/12/2012 20:51") $adates | group-object -NoElement | where-object {$_.count -gt 1}
Thank you, thank you, thank you. I registered to say that !
I knew it was possible but I was so far in the forest i could not see the trees :o(