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