mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-24 08:53:59 +01:00
Updated check-bios.ps1 and check-motherboard.ps1
This commit is contained in:
parent
83d8d645ee
commit
01d9659976
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user