run ISE as admin
# Get the list of VMs with their allocated RAM and assigned vCPUs $vmList = Get-VM | Select-Object Name, @{Name="MemoryAssignedGB";Expression={[math]::round($_.MemoryAssigned / 1GB, 2)}}, @{Name="vCPUs";Expression={$_.ProcessorCount}} # Display the results in a table $vmList | Format-Table -AutoSize