Is that assigned memory or actually used memory, or both?
There are quite a few values for that.
This just shows some of them$vmNames = Get-Content -Path .\vmnames.txt
Get-VM -Name $vmNames |
Judging from your other thread, you seem to want to summarise the memory over all VMs.$vmNames = Get-Content -Path .\vmnames.txt
Get-VM -Name $vmNames | Measure-Object -Property MemoryGB -Sum
It is actual usage.
And I need to end up with one number of the total usage of ram for all vm´s (sum).
You could do like this$vmNames = Get-Content -Path .\vmnames.txt
(Get-VM -Name $vmNames).ExtensionData.Summary.QuickStats.GuestMemoryUsage | Measure-Object -Sum
Just what I was looking for. Thanks.