下面是我尝试过的代码片段,但由于它有一个错误,任何人都可以帮助我编辑这个
$colItems4 = Get-WMIObject -class Win32_PhysicalMemory | Measure-Object -Property capacity -Sum |
foreach ($objItem4 in $colItems4 )
{
write-host "Total Physical Ram : " $objItem4.Sum
}