10 Replies Latest reply on Mar 1, 2013 6:46 AM by yezdi

    One liner to convert CapacityKB

    yezdi Master
    vExpert

      Hi all,

       

      i've got one liner from VMware KB to get the VMs with RDMs. I've added CapacityKB to get the RDM size. But it comes in KB.

       

      $cluster_name = " Cluster 4" get-cluster $cluster_name | Get-VM | Get-HardDisk -DiskType "RawPhysical","RawVirtual" | Select Parent,Name,CapacityKB/(1024),DiskType,ScsiCanonicalName,DeviceName | Format-Table -AutoSize | Out-File –FilePath "Z:\output\RDM-list-$cluster_name.txt"

       

      Parent  Name        CapacityKB    DiskType ScsiCanonicalName                    DeviceName                                                ------  ------      ------        ------                          ----        ----------    -------- -----------------                    ----------                                                XXXXXXX  Hard disk 2  1638400000 RawPhysical naa.6000d7760000c5e375b6af59c106f876 vml.02001600006000d7760000c5e375b6af59c106f876495053544f52

       

       

      Can you please help me to get the output in Mb and Gb?