VMware Cloud Community
COS
Expert
Expert
Jump to solution

Compare disk sizes fo "hard disk 1" and "hard disk 2"

Is it possible to get a list of all VM's where "Hard disk 1" is smaller than "Hard disk 2"?

Thanks

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Something like this?

Get-VM |

where {(Get-HardDisk -VM $_ -Name 'Hard disk 1').CapacityGB -lt (Get-HardDisk -VM $_ -Name 'Hard disk 2' -ErrorAction SilentlyContinue).CapacityGB}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
1 Reply
LucD
Leadership
Leadership
Jump to solution

Something like this?

Get-VM |

where {(Get-HardDisk -VM $_ -Name 'Hard disk 1').CapacityGB -lt (Get-HardDisk -VM $_ -Name 'Hard disk 2' -ErrorAction SilentlyContinue).CapacityGB}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos