mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-19 08:52:05 +02:00
Updated the manuals
This commit is contained in:
@@ -6,7 +6,7 @@ This PowerShell script queries the BIOS status and prints it.
|
||||
Parameters
|
||||
----------
|
||||
```powershell
|
||||
PS> ./check-bios.ps1 [<CommonParameters>]
|
||||
/home/markus/Repos/PowerShell/scripts/check-bios.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
@@ -17,7 +17,7 @@ Example
|
||||
-------
|
||||
```powershell
|
||||
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
|
||||
|
||||
```
|
||||
|
||||
@@ -39,7 +39,7 @@ Script Content
|
||||
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
|
||||
@@ -48,27 +48,26 @@ Script Content
|
||||
|
||||
try {
|
||||
if ($IsLinux) {
|
||||
Write-Progress "Querying BIOS details..."
|
||||
$model = (sudo dmidecode -s system-product-name)
|
||||
if ("$model" -ne "") {
|
||||
$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-Progress -completed "."
|
||||
if ("$model" -eq "") { exit 0 } # no information
|
||||
Write-Progress "Querying BIOS details..."
|
||||
$version = (sudo dmidecode -s bios-version)
|
||||
$releaseDate = (sudo dmidecode -s bios-release-date)
|
||||
$manufacturer = (sudo dmidecode -s system-manufacturer)
|
||||
Write-Progress -completed "Done."
|
||||
} else {
|
||||
$BIOS = Get-CimInstance -ClassName Win32_BIOS
|
||||
$model = $BIOS.Name.Trim()
|
||||
$version = $BIOS.Version.Trim()
|
||||
$serialNumber = $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)"
|
||||
} else {
|
||||
Write-Host "✅ BIOS model $model by $manufacturer (version $version, S/N $serialNumber)"
|
||||
}
|
||||
$details = Get-CimInstance -ClassName Win32_BIOS
|
||||
$model = $details.Name.Trim()
|
||||
$version = $details.Version.Trim()
|
||||
$serial = $details.SerialNumber.Trim()
|
||||
$manufacturer = $details.Manufacturer.Trim()
|
||||
}
|
||||
if ($model -eq "To be filled by O.E.M.") { $model = "N/A" }
|
||||
if ($version -eq "To be filled by O.E.M.") { $version = "N/A" }
|
||||
if ("$releaseDate" -ne "") { $releaseDate = " of $releaseDate" }
|
||||
if ("$serial" -eq "") { $serial = "N/A" }
|
||||
if ($serial -eq "To be filled by O.E.M.") { $serial = "N/A" }
|
||||
Write-Host "✅ BIOS model $model, version $($version)$($releaseDate), S/N $serial by $manufacturer"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
@@ -76,4 +75,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-bios.ps1 as of 08/15/2024 09:50:45)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-bios.ps1 as of 11/08/2024 12:34:46)*
|
||||
|
Reference in New Issue
Block a user