Update check-uptime.ps1

This commit is contained in:
Markus Fleschutz 2021-12-04 14:10:16 +01:00
parent fdc9965b30
commit 7a7a92ecc4

View File

@ -24,21 +24,23 @@ try {
$Hours = $Uptime.Hours $Hours = $Uptime.Hours
$Minutes = $Uptime.Minutes $Minutes = $Uptime.Minutes
$Reply = "I'm up for "
if ($Days -eq "1") { if ($Days -eq "1") {
$Reply = "Up for 1 day, " $Reply += "1 day, "
} else { } elseif ($Days -ne "0") {
$Reply = "Up for $Days days, " $Reply += "$Days days, "
} }
if ($Hours -eq "1") { if ($Hours -eq "1") {
$Reply += "1 hour " $Reply += "1 hour "
} else { } elseif ($Hours -ne "0") {
$Reply += "$Hours hours " $Reply += "$Hours hours "
} }
if ($Minutes -eq "1") { if ($Minutes -eq "1") {
$Reply += "and 1 minute." $Reply += "and 1 minute"
} else { } elseif ($Minutes -ne "0") {
$Reply += "and $Minutes minutes." $Reply += "and $Minutes minutes"
} }
$Reply += "."
"✔️ $Reply" "✔️ $Reply"
& "$PSScriptRoot/speak-english.ps1" "$Reply" & "$PSScriptRoot/speak-english.ps1" "$Reply"
exit 0 # success exit 0 # success