Reputation: 4244
I am looking for a way to find single cooked value output of total memory and memory in use.
gwmi Win32_OperatingSystem | select TotalVisibleMemorySize, FreePhysicalMemory
so far i have this, but i need only the value output.
for both of them.
thanks in advance shay ;)
Upvotes: 2
Views: 7467
Reputation: 200363
Try this:
gwmi Win32_OperatingSystem | % {
$_.TotalVisibleMemorySize
$_.FreePhysicalMemory
}
Upvotes: 4
Reputation: 1862
If I correctly understand what you're asking for, I think this will help:
$memoryInfo = gwmi -Query "SELECT TotalVisibleMemorySize, FreePhysicalMemory FROM Win32_OperatingSystem"
$totalVisibleMemorySize = $memoryInfo.TotalVisibleMemorySize
$freePhysicalMemory = $memoryInfo.FreePhysicalMemory
Upvotes: 3