Update check-weather.ps1

This commit is contained in:
Markus Fleschutz 2021-12-01 12:53:37 +01:00
parent d9f65fd00d
commit becc2d5a06
2 changed files with 5 additions and 2 deletions

View File

@ -97,7 +97,7 @@ Computer, open `name` settings
Computer, check `name` Computer, check `name`
---------------------- ----------------------
* let the computer check something. * let the computer check something.
* replace `name` by: "CPU", "date", "DNS", "operating system", "ping", "swap space", "time", "time zone", or "up-time". * replace `name` by: "CPU", "date", "DNS", "operating system", "ping", "swap space", "time", "time zone", "up-time", or "weather".
🔊 Audio 🔊 Audio

View File

@ -1,6 +1,6 @@
<# <#
.SYNOPSIS .SYNOPSIS
Checks the weather for critical values Checks the weather
.DESCRIPTION .DESCRIPTION
Checks the current weather for critical values. Checks the current weather for critical values.
.PARAMETER location .PARAMETER location
@ -52,6 +52,9 @@ try {
} else { } else {
"WEATHER ALERT: $Result" "WEATHER ALERT: $Result"
} }
$Reply = "$($Temp)°C, $($Precip)mm rain, $($Humidity)% humidity, $($Clouds)% clouds with wind $($WindSpeed)km/h from $WindDir at $Area ($Region)"
"✔️ $Reply"
& "$PSScriptRoot/speak-english.ps1" "$Reply"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"