Get Hyper V Virtual Machines Memory Configuration Powershell

Microsoft Windows Power shell to list down the Hyper V Virtual Machines Memory configuration for Hyper V Cluster, you can also use it for non cluster environment with simple modification.

#Start-Process powershell -Verb runAs Administrator

if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }

#List down the Virtual Machine Assigned Memory

get-vm -computername (Get-ClusterNode –Cluster EHYPERVCLS03)| select vmname, ComputerName,state, dynamicmemoryenabled,@{n="Minimum(gb)";e={$_.memoryminimum/1gb}}, @{n="Maximum(gb)";e={$_.memorymaximum/1gb}}, @{n="Startup(gb)";e={$_.memorystartup/1gb}}, @{n="Currently Assigned(gb)";e={$_.memoryassigned/1gb}} |ft
Output Example

Leave a Reply

Your email address will not be published. Required fields are marked *