I\'m trying to get the physical memory size using PowerShell, but without using get-wmiobject.
I have been using the following PS cmdlet to get the physical memory s
Id like to say that instead of going with the systeminfo this would help over to get the total physical memory in GB's the machine
Get-CimInstance Win32_PhysicalMemory | Measure-Object -Property capacity -Sum | Foreach {"{0:N2}" -f ([math]::round(($_.Sum / 1GB),2))}
you can pass this value to the variable and get the gross output for the total physical memory in the machine
$totalmemory = Get-CimInstance Win32_PhysicalMemory | Measure-Object -Property capacity -Sum | Foreach {"{0:N2}" -f ([math]::round(($_.Sum / 1GB),2))}
$totalmemory