I'm trying to count versions of a specific DLL on our servers. Finding what version we have is fairly easy, but I want a rolled up count of each one. This is what I have so far:
gci System.Web.Mvc.dll -Recurse -ErrorAction SilentlyContinue |
select-object -ExpandProperty VersionInfo |
Select FileVersion |
sort-object { [string]$_.FileVersion }
So if the above output:
1.2.3.4
1.2.3.4
1.2.3.4
5.6.7.8
9.0.1.2
9.0.1.2
I'd want:
1.2.3.4 3
9.0.1.2 2
5.6.7.8 1
Any idea how I would do that?