Get-WmiObject -Class Win32_PhysicalMemory | %{ $_.Capacity} | Measure-Object -Sum | %{ ($_.sum /1024/1024/1024).toString() + "GB"}
他のマシンのを調べる場合は -ComputerName オプションを使う
Get-WmiObject -Class Win32_PhysicalMemory -ComputerName <コンピューター名>| %{ $_.Capacity} | Measure-Object -Sum | %{ ($_.sum /1024/1024/1024).toString() + "GB"}
メモ:Invoke-commandでもできる
Invoke-Command -ComputerName 123test-db -ScriptBlock {Get-WmiObject -Class Win32_PhysicalMemory | %{ $_.Capacity} | Measure-Object -Sum | %{ ($_.sum /1024/1024/1024).toString() + "GB"}}