mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-13 05:28:18 +02:00
Add check-iss.ps1
This commit is contained in:
parent
42ef987d69
commit
70422aaeb0
@ -25,7 +25,7 @@ More supported voice commands are:
|
|||||||
|
|
||||||
`Computer, check` [name]
|
`Computer, check` [name]
|
||||||
------------------------
|
------------------------
|
||||||
Lets the computer check something, replace [name] by: `Christmas`, `CPU`, `date`, `DNS`, `drives`, `Earth` (fun), `headlines`, `Moon`, `New Year`, `operating system`, `ping`, `Sun`, `swap space`, `time`, `time zone`, `up-time`, `VPN`, or `weather`.
|
Lets the computer check something, replace [name] by: `Christmas`, `CPU`, `date`, `DNS`, `drives`, `Earth` (fun), `headlines`, `ISS`, `Moon`, `New Year`, `operating system`, `ping`, `Sun`, `swap space`, `time`, `time zone`, `up-time`, `VPN`, or `weather`.
|
||||||
|
|
||||||
|
|
||||||
`Computer, open` [name] `browser`
|
`Computer, open` [name] `browser`
|
||||||
|
24
Scripts/check-iss.ps1
Normal file
24
Scripts/check-iss.ps1
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Checks the ISS
|
||||||
|
.DESCRIPTION
|
||||||
|
This script checks the International Space Station (ISS) and report the position by text-to-speech (TTS).
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ./check-iss
|
||||||
|
.LINK
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
.NOTES
|
||||||
|
Author: Markus Fleschutz · License: CC0
|
||||||
|
#>
|
||||||
|
|
||||||
|
try {
|
||||||
|
$ISS = (Invoke-WebRequest "http://api.open-notify.org/iss-now.json" -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json
|
||||||
|
|
||||||
|
$Reply = "ISS is at $($ISS.iss_position.longitude)° longitude, $($ISS.iss_position.latitude)° latitude."
|
||||||
|
"✔️ $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