Update check-battery.ps1

This commit is contained in:
Markus Fleschutz 2023-04-07 19:28:57 +02:00
parent 1eba16843f
commit 035473d846

View File

@ -5,7 +5,7 @@
This PowerShell script queries the status of the system battery and prints it. This PowerShell script queries the status of the system battery and prints it.
.EXAMPLE .EXAMPLE
PS> ./check-battery PS> ./check-battery
Battery 21%, 54 min. remaining 21% battery life, 54 min remaining
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -32,11 +32,11 @@ try {
} }
"Offline" { "Offline" {
if ($Percent -eq 100) { if ($Percent -eq 100) {
$Reply = "Battery $Percent% full, $Remaining min. remaining" $Reply = "$Percent% full battery, $Remaining min remaining"
} elseif ($Remaining -gt 30) { } elseif ($Remaining -gt 30) {
$Reply = "Battery $Percent%, $Remaining min. remaining" $Reply = "$Percent% battery life, $Remaining min remaining"
} else { } else {
$Reply = "⚠️ Battery $Percent%, only $Remaining min. remaining" $Reply = "⚠️ $Percent% battery life, only $Remaining min remaining"
} }
} }
} }