From 01d9659976b04a7989b3b1d1bb71121aace5f991 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Thu, 10 Oct 2024 20:41:36 +0200 Subject: [PATCH] Updated check-bios.ps1 and check-motherboard.ps1 --- scripts/check-bios.ps1 | 12 ++++++------ scripts/check-motherboard.ps1 | 8 +++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/scripts/check-bios.ps1 b/scripts/check-bios.ps1 index 9397e2d2..36d44813 100755 --- a/scripts/check-bios.ps1 +++ b/scripts/check-bios.ps1 @@ -5,7 +5,7 @@ This PowerShell script queries the BIOS status and prints it. .EXAMPLE PS> ./check-bios.ps1 - ✅ BIOS model P62 v02.67 by HP (version HPQOEM - 5, S/N CZC1080B01) + ✅ BIOS model P62 v02.67, version HPQOEM - 5, S/N CZC1080B01 by HP .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -20,19 +20,19 @@ try { $version = (sudo dmidecode -s bios-version) $releaseDate = (sudo dmidecode -s bios-release-date) $manufacturer = (sudo dmidecode -s system-manufacturer) - Write-Host "✅ BIOS model $model by $manufacturer (version $version of $releaseDate)" + Write-Host "✅ BIOS model $model, version $version of $releaseDate by $manufacturer" } Write-Progress -completed "." } else { $BIOS = Get-CimInstance -ClassName Win32_BIOS $model = $BIOS.Name.Trim() $version = $BIOS.Version.Trim() - $serialNumber = $BIOS.SerialNumber.Trim() + $serial = $BIOS.SerialNumber.Trim() $manufacturer = $BIOS.Manufacturer.Trim() - if ($serialNumber -eq "To be filled by O.E.M.") { - Write-Host "✅ BIOS model $model by $manufacturer (version $version)" + if ($serial -eq "To be filled by O.E.M.") { + Write-Host "✅ BIOS model $model, version $version by $manufacturer" } else { - Write-Host "✅ BIOS model $model by $manufacturer (version $version, S/N $serialNumber)" + Write-Host "✅ BIOS model $model, version $version, S/N $serial by $manufacturer" } } exit 0 # success diff --git a/scripts/check-motherboard.ps1 b/scripts/check-motherboard.ps1 index ebfd3243..dd278c57 100755 --- a/scripts/check-motherboard.ps1 +++ b/scripts/check-motherboard.ps1 @@ -4,10 +4,8 @@ .DESCRIPTION This PowerShell script lists the motherboard details. .EXAMPLE - PS> ./list-motherboard.ps1 - - Manufacturer : Gigabyte Technology Co., Ltd. - ... + PS> ./check-motherboard.ps1 + ✅ Motherboard Calla_LC by LN .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -18,7 +16,7 @@ try { if ($IsLinux) { } else { $details = Get-WmiObject -Class Win32_BaseBoard - "✅ $($details.Product) motherboard by $($details.Manufacturer)" + "✅ Motherboard $($details.Product) by $($details.Manufacturer)" } exit 0 # success } catch {