2022-11-14 13:33:53 +01:00
|
|
|
|
<#
|
|
|
|
|
.SYNOPSIS
|
|
|
|
|
Checks BIOS details
|
|
|
|
|
.DESCRIPTION
|
2022-12-28 10:42:38 +01:00
|
|
|
|
This PowerShell script queries and prints BIOS details.
|
2022-11-14 13:33:53 +01:00
|
|
|
|
.EXAMPLE
|
|
|
|
|
PS> ./check-bios
|
2022-12-28 10:42:38 +01:00
|
|
|
|
✅ F6 BIOS by American Megatrends Inc. (S/N NXA82EV0EBB0760, version ALASKA - 1072009)
|
2022-11-14 13:33:53 +01:00
|
|
|
|
.LINK
|
|
|
|
|
https://github.com/fleschutz/PowerShell
|
|
|
|
|
.NOTES
|
|
|
|
|
Author: Markus Fleschutz | License: CC0
|
|
|
|
|
#>
|
|
|
|
|
|
|
|
|
|
try {
|
2022-12-04 10:03:10 +01:00
|
|
|
|
Write-Progress "Querying BIOS details..."
|
2022-11-14 13:33:53 +01:00
|
|
|
|
if ($IsLinux) {
|
2022-12-28 11:04:21 +01:00
|
|
|
|
$Model = (sudo dmidecode -s system-product-name)
|
2022-12-31 19:33:18 +01:00
|
|
|
|
if ("$Model" -ne "") {
|
|
|
|
|
$Manufacturer = (sudo dmidecode -s system-manufacturer)
|
|
|
|
|
$Version = (sudo dmidecode -s bios-version)
|
|
|
|
|
$RelDate = (sudo dmidecode -s bios-release-date)
|
2023-01-03 10:56:05 +01:00
|
|
|
|
Write-Host "✅ $Model BIOS by $Manufacturer ($Version release of $RelDate)"
|
2022-12-31 19:33:18 +01:00
|
|
|
|
}
|
2022-11-14 13:33:53 +01:00
|
|
|
|
} else {
|
|
|
|
|
$BIOS = Get-CimInstance -ClassName Win32_BIOS
|
2022-12-19 17:53:25 +01:00
|
|
|
|
$Model = $BIOS.Name.Trim()
|
2022-12-28 11:04:21 +01:00
|
|
|
|
$Manufacturer = $BIOS.Manufacturer.Trim()
|
2022-12-19 17:53:25 +01:00
|
|
|
|
$Serial = $BIOS.SerialNumber.Trim()
|
|
|
|
|
$Version = $BIOS.Version.Trim()
|
2023-01-03 10:56:05 +01:00
|
|
|
|
Write-Host "✅ $Model BIOS by $Manufacturer (S/N $Serial, version $Version)"
|
2022-11-14 13:33:53 +01:00
|
|
|
|
}
|
2022-12-31 19:33:18 +01:00
|
|
|
|
Write-Progress -Completed " "
|
2022-11-14 13:33:53 +01:00
|
|
|
|
exit 0 # success
|
|
|
|
|
} catch {
|
|
|
|
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
|
|
|
|
exit 1
|
2022-12-28 11:04:21 +01:00
|
|
|
|
}
|