Duplicate values in the result.

Welcome Forums General PowerShell Q&A Duplicate values in the result.

Viewing 3 reply threads
  • Author
    Posts
    • #206700
      Participant
      Topics: 3
      Replies: 2
      Points: 25
      Rank: Member

      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.

    • #206721
      Participant
      Topics: 4
      Replies: 2231
      Points: 5,414
      Helping Hand
      Rank: Community MVP

      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.

    • #206736
      Moderator
      Topics: 3
      Replies: 216
      Points: 1,176
      Helping Hand
      Rank: Community Hero

      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.

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

      $VMDKs | select parent, capacityGB -Unique

      Thank you.

    • #206919
      Participant
      Topics: 0
      Replies: 1
      Points: 9
      Rank: Member

      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>

      • This reply was modified 2 months, 3 weeks ago by smithjohn7725.
Viewing 3 reply threads
  • You must be logged in to reply to this topic.