Update check-power.ps1

This commit is contained in:
Markus Fleschutz 2023-10-17 21:17:04 +02:00
parent a147fdec4d
commit 49b14b8d79

View File

@ -29,20 +29,20 @@ try {
$reply = "✅ Battery charging... ($percent%)" $reply = "✅ Battery charging... ($percent%)"
} }
} else { # must be offline } else { # must be offline
if (($remaining -eq 0) -and ($percent -gt 90)) { if (($remaining -eq 0) -and ($percent -ge 60)) {
$reply = "✅ Battery $percent% full" $reply = "✅ Battery $percent% full"
} elseif ($remaining -eq 0) { } elseif ($remaining -eq 0) {
$reply = "✅ Battery at $percent%" $reply = "✅ Battery at $percent%"
} elseif ($remaining -le 5) { } elseif ($remaining -le 5) {
$reply = "⚠️ Battery at $percent% · ONLY $remaining MIN remaining" $reply = "⚠️ Battery at $percent% · ONLY $($remaining)min remaining"
} elseif ($remaining -le 30) { } elseif ($remaining -le 30) {
$reply = "⚠️ Battery at $percent% · only $remaining min remaining" $reply = "⚠️ Battery at $percent% · only $($remaining)min remaining"
} elseif ($percent -lt 10) { } elseif ($percent -lt 10) {
$reply = "⚠️ Battery at $percent% · $remaining min remaining" $reply = "⚠️ Battery at $percent% · $($remaining)min remaining"
} elseif ($percent -ge 80) { } elseif ($percent -ge 60) {
$reply = "✅ Battery $percent% full · $remaining min remaining" $reply = "✅ Battery $percent% full · $($remaining)min remaining"
} else { } else {
$reply = "✅ Battery at $percent% · $remaining min remaining" $reply = "✅ Battery at $percent% · $($remaining)min remaining"
} }
} }
$powerScheme = (powercfg /getactivescheme) $powerScheme = (powercfg /getactivescheme)