mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-08 09:04:18 +01:00
Add check-bios.ps1
This commit is contained in:
parent
8ec7113298
commit
d645f5940d
29
Scripts/check-bios.ps1
Normal file
29
Scripts/check-bios.ps1
Normal file
@ -0,0 +1,29 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks BIOS details
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries BIOS details and prints it.
|
||||
.EXAMPLE
|
||||
PS> ./check-bios
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
if ($IsLinux) {
|
||||
# TODO
|
||||
} else {
|
||||
$BIOS = Get-CimInstance -ClassName Win32_BIOS
|
||||
$Manufacturer = $BIOS.Manufacturer
|
||||
$Model = $BIOS.Name
|
||||
$SerialNumber = $BIOS.SerialNumber
|
||||
$Version = $BIOS.Version
|
||||
"✅ $Manufacturer BIOS $($Model): S/N $SerialNumber, version $Version"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
@ -46,7 +46,7 @@ try {
|
||||
} else {
|
||||
$Details = Get-WmiObject -Class Win32_Processor
|
||||
$DeviceName = $Details.Name.trim()
|
||||
"✅ $DeviceName ($($Details.DeviceID), $($Details.MaxClockSpeed)MHz, $Temp)."
|
||||
"✅ $($DeviceName): $($Details.DeviceID), $($Details.MaxClockSpeed)MHz, $Temp"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
|
@ -14,6 +14,7 @@
|
||||
& "$PSScriptRoot/check-operating-system.ps1"
|
||||
& "$PSScriptRoot/check-uptime.ps1"
|
||||
& "$PSScriptRoot/check-time-zone.ps1"
|
||||
& "$PSScriptRoot/check-bios.ps1"
|
||||
& "$PSScriptRoot/check-cpu.ps1"
|
||||
& "$PSScriptRoot/check-ram.ps1"
|
||||
& "$PSScriptRoot/check-gpu.ps1"
|
||||
|
@ -25,7 +25,7 @@ try {
|
||||
$BuildNo = $OSDetails.BuildNumber
|
||||
$Serial = $OSDetails.SerialNumber
|
||||
$InstallDate = $OSDetails.InstallDate
|
||||
"✅ $Name ($Arch, v$Version, S/N $Serial, installed $($InstallDate.ToShortDateString()))."
|
||||
"✅ $($Name): $Arch, v$Version, S/N $Serial, installed $($InstallDate.ToShortDateString())"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
|
@ -52,7 +52,7 @@ try {
|
||||
[float]$Voltage = $Bank.ConfiguredVoltage / 1000.0
|
||||
$Manufacturer = $Bank.Manufacturer
|
||||
$Location = "$($Bank.BankLabel)/$($Bank.DeviceLocator)"
|
||||
"✅ $($Capacity)GB $Type ($($Speed)MHz, $($Voltage)V) at $Location by $Manufacturer."
|
||||
"✅ $($Capacity)GB $($Type) by $($Manufacturer): $($Speed)MHz, $($Voltage)V at $Location"
|
||||
}
|
||||
}
|
||||
exit 0 # success
|
||||
|
@ -5,7 +5,7 @@
|
||||
This PowerShell script queries S.M.A.R.T. HDD/SSD device details and prints it.
|
||||
.EXAMPLE
|
||||
PS> ./check-smart-devices
|
||||
✅ 1TB Samsung SSD 970 EVO via NVMe, 37°C, 2388 hours, 289x on, v2B2QEXE7, selftest passed.
|
||||
✅ 1TB Samsung SSD 970 EVO via NVMe: 37°C, 2388 hours, 289x on, v2B2QEXE7, selftest passed
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -65,7 +65,7 @@ try {
|
||||
$PowerOn = $Details.power_cycle_count
|
||||
$Hours = $Details.power_on_time.hours
|
||||
if ($Details.smart_status.passed) { $Status = "passed" } else { $Status = "FAILED" }
|
||||
"✅ $($Capacity)$ModelName via $Protocol, $($Temp)°C, $($Hours) hours, $($PowerOn)x on, v$($Firmware), selftest $Status."
|
||||
"✅ $($Capacity)$ModelName via $($Protocol): $($Temp)°C, $($Hours) hours, $($PowerOn)x on, v$($Firmware), selftest $Status"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
|
Loading…
Reference in New Issue
Block a user