mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-22 20:51:17 +01:00
Update check-battery.ps1
This commit is contained in:
parent
1eba16843f
commit
035473d846
@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user