Update some scripts

This commit is contained in:
Markus Fleschutz 2021-12-02 15:25:42 +01:00
parent 7bce556044
commit 909c8fa0ff
3 changed files with 7 additions and 7 deletions

View File

@ -23,15 +23,15 @@ try {
} }
if ($Temp -gt 80) { if ($Temp -gt 80) {
$Reply = "CPU has $Temp °C: too high!" $Reply = "$($Temp)°C CPU temperature, that's too high!"
} elseif ($Temp -gt 50) { } elseif ($Temp -gt 50) {
$Reply = "CPU has $Temp °C: quite high" $Reply = "$($Temp)°C CPU temperature, that's quite high"
} elseif ($Temp -gt 0) { } elseif ($Temp -gt 0) {
$Reply = "CPU has $Temp °C" $Reply = "$(Temp)°C CPU temperature"
} elseif ($Temp -gt -20) { } elseif ($Temp -gt -20) {
$Reply = "CPU has $Temp °C: quite low" $Reply = "$(Temp)°C CPU temperature, that's quite low"
} else { } else {
$Reply = "CPU has $Temp °C: too low!" $Reply = "$(Temp)°C CPU temperature, that's too low!"
} }
"✔️ $Reply" "✔️ $Reply"
& "$PSScriptRoot/speak-english.ps1" "$Reply" & "$PSScriptRoot/speak-english.ps1" "$Reply"

View File

@ -31,7 +31,7 @@ try {
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
$Average = [math]::round($Count / $Elapsed, 1) $Average = [math]::round($Count / $Elapsed, 1)
$Reply = "DNS resolution is $Average domains per second" $Reply = "$Average domains per second DNS resolution"
"✔️ $Reply" "✔️ $Reply"
& "$PSScriptRoot/speak-english.ps1" "$Reply" & "$PSScriptRoot/speak-english.ps1" "$Reply"
exit 0 # success exit 0 # success

View File

@ -37,7 +37,7 @@ try {
} }
$Avg = $Avg / $Pings.count $Avg = $Avg / $Pings.count
$Reply = "Average ping is $($Avg)ms ($($Min)ms min, $($Max)ms max)" $Reply = "$($Avg)ms average ping time ($($Min)ms min, $($Max)ms max)"
"✔️ $Reply" "✔️ $Reply"
& "$PSScriptRoot/speak-english.ps1" "$Reply" & "$PSScriptRoot/speak-english.ps1" "$Reply"
exit 0 # success exit 0 # success