Update check-ram.ps1

This commit is contained in:
Markus Fleschutz 2022-10-13 19:51:02 +02:00
parent 83d205e717
commit ce16c33272

View File

@ -41,6 +41,9 @@ function GetRAMType { param([int]$Type)
} }
try { try {
if ($IsLinux) {
# TODO
} else {
$Banks = Get-WmiObject -Class Win32_PhysicalMemory $Banks = Get-WmiObject -Class Win32_PhysicalMemory
foreach ($Bank in $Banks) { foreach ($Bank in $Banks) {
$Capacity = $Bank.Capacity / (1024 * 1024 * 1024) $Capacity = $Bank.Capacity / (1024 * 1024 * 1024)
@ -49,11 +52,12 @@ try {
[float]$Voltage = $Bank.ConfiguredVoltage / 1000.0 [float]$Voltage = $Bank.ConfiguredVoltage / 1000.0
$Vendor = $Bank.Manufacturer $Vendor = $Bank.Manufacturer
if ("$($Bank.BankLabel)" -ne "") { if ("$($Bank.BankLabel)" -ne "") {
$BankName = $Bank.BankLabel $Location = $Bank.BankLabel
} else { } else {
$BankName = $Bank.DeviceLocator $Location = $Bank.DeviceLocator
}
"$($Capacity)GB $Type ($($Speed)MHz, $($Voltage)V, $Vendor) in $Location bank."
} }
"$($Capacity)GB $Type ($($Speed)MHz, $($Voltage)V, $Vendor) in $BankName bank."
} }
exit 0 # success exit 0 # success
} catch { } catch {