Hyper-V has a hard limit for the memory resources in the host server. You cannot assign more RAM to your running VMs than your host has as physical RAM.
The script Get-VMResourceSummary.ps1 lists all VMs on a host with their RAM and vCPU configurations. You get a list of each VM, its running state, static RAM assignment, maximum Dynamic Memory (if configured) and vCPU assignment.
Two summary tables inform you how much RAM and vCPUs your VMs need altogehter and how much of these core resources is assigned to the running VMs. That way you know quickly if your host's resources allow for additional VMs or not.
The script does not use any parameters. Just launch it in a PowerShell window or in PowerShell ISE. Make sure to run PowerShell as an Administrator to get appropriate values.
The script queries the local computer by default. If you want to query a remote computer adjust the following line in the script code:
The script should run with Hyper-V in Windows Server 2012 and newer. It should as well run with client Hyper-V in Windows 8.1 or newer.
The script was written by Nils Kaczenski. It comes without any warranty or support. Use at your own risk.