Drawing a weird blank here as i'm sure i've done this before. I have these objects:
Name01 Capacity0
------ ---------
P1234 4096
P1234 4096
P1234 4096
How do i turn it into only one object containing the sum of all 'capacity0' like this? :
Name01 Capacity0
------ ---------
P1234 12288
I know how to get the sum for example:
... Select Name01,Capacity0 | Measure-Object -Property Capacity0 -sum
but then i lose the 'name01' property if i pipe it like that.
What's the best way? Something with group-object maybe? Struggling with the logic i should use. Much appreciated.