Powershell获取系统内存的大小,可以通过wmi对象:Win32_ComputerSystem
具体代码如下:
PS E:> Get-WmiObject -Class Win32_ComputerSystem Domain : WORKGROUP Manufacturer : LENOVO Model : 20090 Name : BAOZHEN-PC PrimaryOwnerName : baozhen TotalPhysicalMemory : 4236099584 PS E:> (Get-WmiObject -Class Win32_ComputerSystem).TotalPhysicalMemory /1gb 3.94517517089844 PS E:> $memory=(Get-WmiObject -Class Win32_ComputerSystem).TotalPhysicalMemory /1gb
PS E:> "系统物理内存 = $([Math]::Round($memory,2)) GB"
系统物理内存 = 3.95 GB
本文链接: https://www.pstips.net/powershell-get-total-physical-memory.html
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!
are There Louis Vuitton Outlet Louis Vuitton Outlet Rome Italy