Duplicate values in the result.

Hello,

I am trying to identify the VMs that has the same size VMDKs.

$VMDKs | select parent, capacityGB

Parent CapacityGB


MyVMName 80
MyVMName 60
MyVMName 15
MyVMName 61
MyVMName 91
MyVMName 25
MyVMName 100
MyVMName 61

I would like to see output if there two similar size VMDKs since 61 is duplicate.

MyVMName 61

 

Thank you.

When you post code or example data or output data please format it as code using the code tag button labeld “PRE”. Thanks.

You could use the cmdlet Group-Object to achieve what you’re asking for. Please read the complete help including the examples to learn how to use it.

If I understand you correctly, you are looking for unique values in your output, if so then use -Unique flag with Select-Object

[pre]$VMDKs | select parent, capacityGB -Unique[/pre]

Thank you.

Splendid! An awe-inspiring blend of the ordinary embarrassments of existence with the more profound topics that direct us as the years progressed. I never thought a rodent, especially the long-dead assortment, could convey such significance. Very much done all around.

Thankyou
<p style=“text-align: center;”>Assignment</p>