mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-23 00:13:36 +01:00
Update check-cpu.ps1 and check-ram.ps1
This commit is contained in:
parent
60cab826d7
commit
3bfa372584
@ -5,7 +5,7 @@
|
|||||||
This PowerShell script queries CPU details (name, type, speed, temperature, etc.) and prints it.
|
This PowerShell script queries CPU details (name, type, speed, temperature, etc.) and prints it.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./check-cpu
|
PS> ./check-cpu
|
||||||
✅ CPU AMD Ryzen 5 5500U with Radeon Graphics (CPU0, 2100MHz, 31.3°C)
|
✅ AMD Ryzen 5 5500U with Radeon Graphics (CPU0, 2100MHz, 31.3°C)
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -53,7 +53,7 @@ try {
|
|||||||
$DeviceID = $Details.DeviceID
|
$DeviceID = $Details.DeviceID
|
||||||
$Speed = "$($Details.MaxClockSpeed)MHz"
|
$Speed = "$($Details.MaxClockSpeed)MHz"
|
||||||
$Socket = $Details.SocketDesignation
|
$Socket = $Details.SocketDesignation
|
||||||
"$Status CPU $CPUName ($DeviceID, $Speed, socket $Socket, $Temp)"
|
"$Status $CPUName ($DeviceID, $Speed, socket $Socket, $Temp)"
|
||||||
}
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -41,19 +41,19 @@ function GetRAMType { param([int]$Type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Bytes2String { param([int64]$Bytes)
|
function Bytes2String { param([int64]$Bytes)
|
||||||
if ($Bytes -lt 1000) { return "$Bytes bytes" }
|
if ($Bytes -lt 1024) { return "$Bytes bytes" }
|
||||||
$Bytes /= 1000
|
$Bytes /= 1024
|
||||||
if ($Bytes -lt 1000) { return "$($Bytes)KB" }
|
if ($Bytes -lt 1024) { return "$($Bytes)KB" }
|
||||||
$Bytes /= 1000
|
$Bytes /= 1024
|
||||||
if ($Bytes -lt 1000) { return "$($Bytes)MB" }
|
if ($Bytes -lt 1024) { return "$($Bytes)MB" }
|
||||||
$Bytes /= 1000
|
$Bytes /= 1024
|
||||||
if ($Bytes -lt 1000) { return "$($Bytes)GB" }
|
if ($Bytes -lt 1024) { return "$($Bytes)GB" }
|
||||||
$Bytes /= 1000
|
$Bytes /= 1024
|
||||||
if ($Bytes -lt 1000) { return "$($Bytes)TB" }
|
if ($Bytes -lt 1024) { return "$($Bytes)TB" }
|
||||||
$Bytes /= 1000
|
$Bytes /= 1024
|
||||||
if ($Bytes -lt 1000) { return "$($Bytes)PB" }
|
if ($Bytes -lt 1024) { return "$($Bytes)PB" }
|
||||||
$Bytes /= 1000
|
$Bytes /= 1024
|
||||||
if ($Bytes -lt 1000) { return "$($Bytes)EB" }
|
if ($Bytes -lt 1024) { return "$($Bytes)EB" }
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -68,7 +68,7 @@ try {
|
|||||||
[float]$Voltage = $Bank.ConfiguredVoltage / 1000.0
|
[float]$Voltage = $Bank.ConfiguredVoltage / 1000.0
|
||||||
$Manufacturer = $Bank.Manufacturer
|
$Manufacturer = $Bank.Manufacturer
|
||||||
$Location = "$($Bank.BankLabel)/$($Bank.DeviceLocator)"
|
$Location = "$($Bank.BankLabel)/$($Bank.DeviceLocator)"
|
||||||
"✅ RAM $Capacity at $Location ($Type, $($Speed)MHz, $($Voltage)V, $Manufacturer)"
|
"✅ $Capacity RAM at $Location ($Type, $($Speed)MHz, $($Voltage)V, $Manufacturer)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
|
Loading…
Reference in New Issue
Block a user