2021-12-04 14:02:56 +01:00
|
|
|
|
<#
|
|
|
|
|
.SYNOPSIS
|
2021-12-05 11:28:14 +01:00
|
|
|
|
Checks the time of zenith
|
2021-12-04 14:02:56 +01:00
|
|
|
|
.DESCRIPTION
|
2021-12-05 11:28:14 +01:00
|
|
|
|
This script queries the time of zenith and answers by text-to-speech (TTS).
|
2021-12-04 14:02:56 +01:00
|
|
|
|
.EXAMPLE
|
2021-12-05 11:28:14 +01:00
|
|
|
|
PS> ./check-zenith
|
2021-12-04 14:02:56 +01:00
|
|
|
|
.NOTES
|
|
|
|
|
Author: Markus Fleschutz · License: CC0
|
|
|
|
|
.LINK
|
|
|
|
|
https://github.com/fleschutz/PowerShell
|
|
|
|
|
#>
|
|
|
|
|
|
|
|
|
|
try {
|
2021-12-05 11:28:14 +01:00
|
|
|
|
$Reply = (Invoke-WebRequest http://wttr.in/?format="Zenith is at %z." -UserAgent "curl" -useBasicParsing).Content
|
2021-12-04 14:02:56 +01:00
|
|
|
|
"✔️ $Reply"
|
|
|
|
|
& "$PSScriptRoot/speak-english.ps1" "$Reply"
|
|
|
|
|
exit 0 # success
|
|
|
|
|
} catch {
|
|
|
|
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
|
|
|
|
exit 1
|
|
|
|
|
}
|