VMware Cloud Community
TheVMinator
Expert
Expert
Jump to solution

Report on VM memory

How do I list only the virtual machines which have less than a certain amount of RAM?

For example:

something like

get-vm | where-object {$_.propertyname -lt 4096}

(where I use the name of that property and show only VMs less than 4GB)

Thanks

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Use the Get-Member cmdlet

Get-VM | gm


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

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

You want the MemoryMB property

get-vm | where-object {$_.MemoryMB -lt 4096}


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

TheVMinator
Expert
Expert
Jump to solution

OK thanks - also - how do I list all the properties of a given object on the command line?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Use the Get-Member cmdlet

Get-VM | gm


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

0 Kudos
TheVMinator
Expert
Expert
Jump to solution

great - thanks again

0 Kudos