mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-02 19:09:13 +01:00
Update check-battery.ps1
This commit is contained in:
parent
128f460e79
commit
4c3327bdb9
@ -5,7 +5,7 @@
|
||||
This PowerShell script queries the status of the system battery and prints it.
|
||||
.EXAMPLE
|
||||
PS> ./check-battery
|
||||
✅ Battery at 21%, 54 min remaining
|
||||
✅ Battery 9% low, 54 min remaining
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -29,12 +29,16 @@ try {
|
||||
$Reply = "✅ Battery charging... ($Percent%)"
|
||||
}
|
||||
} else { # must be offline
|
||||
if ($Percent -ge 80) {
|
||||
$Reply = "✅ Battery $Percent% full, $Remaining min remaining"
|
||||
} elseif ($Remaining -gt 30) {
|
||||
$Reply = "✅ Battery at $Percent%, $Remaining min remaining"
|
||||
} else {
|
||||
if ($Remaining -le 5) {
|
||||
$Reply = "⚠️ Battery at $Percent%, ONLY $Remaining MIN remaining"
|
||||
} elseif ($Remaining -le 30) {
|
||||
$Reply = "⚠️ Battery at $Percent%, only $Remaining min remaining"
|
||||
} elseif ($Percent -ge 80) {
|
||||
$Reply = "✅ Battery $Percent% full, $Remaining min remaining"
|
||||
} elseif ($Percent -le 10) {
|
||||
$Reply = "✅ Battery $Percent% low, $Remaining min remaining"
|
||||
} else {
|
||||
$Reply = "✅ Battery at $Percent%, $Remaining min remaining"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user