Add some check-*.ps1 scripts

This commit is contained in:
Markus Fleschutz
2021-12-05 11:28:14 +01:00
parent 70422aaeb0
commit ea7512c1c0
7 changed files with 96 additions and 8 deletions

22
Scripts/check-zenith.ps1 Normal file
View File

@ -0,0 +1,22 @@
<#
.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
}