mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-26 14:26:10 +01:00
Add check-sun.ps1
This commit is contained in:
parent
afdec27755
commit
fdc9965b30
@ -25,7 +25,7 @@ More supported voice commands are:
|
||||
|
||||
`Computer, check` [name]
|
||||
------------------------
|
||||
Lets the computer check something, replace [name] by: `CPU`, `date`, `DNS`, `drives`, `Earth` (fun), `operating system`, `ping`, `swap space`, `time`, `time zone`, `up-time`, `VPN`, or `weather`.
|
||||
Lets the computer check something, replace [name] by: `CPU`, `date`, `DNS`, `drives`, `Earth` (fun), `operating system`, `ping`, `sun`, `swap space`, `time`, `time zone`, `up-time`, `VPN`, or `weather`.
|
||||
|
||||
|
||||
`Computer, open` [name] `browser`
|
||||
|
22
Scripts/check-sun.ps1
Normal file
22
Scripts/check-sun.ps1
Normal file
@ -0,0 +1,22 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the sun
|
||||
.DESCRIPTION
|
||||
This script determines Sun details and answers by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./check-sun
|
||||
.NOTES
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
#>
|
||||
|
||||
try {
|
||||
$Reply = (Invoke-WebRequest http://wttr.in/?format="Dawn is at %D, sunrise at %S, zenith at %z, sunset at %s, dusk at %d" -UserAgent "curl" -useBasicParsing).Content
|
||||
"✔️ $Reply"
|
||||
& "$PSScriptRoot/speak-english.ps1" "$Reply"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||
exit 1
|
||||
}
|
Loading…
Reference in New Issue
Block a user