mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-23 21:20:51 +01:00
Add some check-*.ps1 scripts
This commit is contained in:
parent
70422aaeb0
commit
ea7512c1c0
@ -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`, `ISS`, `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`, `dawn`, `drives`, `dusk`, `Earth` (fun), `headlines`, `ISS`, `Moon`, `New Year`, `operating system`, `ping`, `sunrise`, `sunset`, `swap space`, `time`, `time zone`, `up-time`, `VPN`, `weather`, or `zenith`.
|
||||||
|
|
||||||
|
|
||||||
`Computer, open` [name] `browser`
|
`Computer, open` [name] `browser`
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Checks the sun
|
Checks the time of dawn
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This script determines Sun details and answers by text-to-speech (TTS).
|
This script queries the time of dawn and answers by text-to-speech (TTS).
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./check-sun
|
PS> ./check-dawn
|
||||||
.NOTES
|
.NOTES
|
||||||
Author: Markus Fleschutz · License: CC0
|
Author: Markus Fleschutz · License: CC0
|
||||||
.LINK
|
.LINK
|
||||||
@ -12,7 +12,7 @@
|
|||||||
#>
|
#>
|
||||||
|
|
||||||
try {
|
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 = (Invoke-WebRequest http://wttr.in/?format="Dawn is at %D." -UserAgent "curl" -useBasicParsing).Content
|
||||||
"✔️ $Reply"
|
"✔️ $Reply"
|
||||||
& "$PSScriptRoot/speak-english.ps1" "$Reply"
|
& "$PSScriptRoot/speak-english.ps1" "$Reply"
|
||||||
exit 0 # success
|
exit 0 # success
|
22
Scripts/check-dusk.ps1
Normal file
22
Scripts/check-dusk.ps1
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Checks the time of dusk
|
||||||
|
.DESCRIPTION
|
||||||
|
This script queries the time of dusk and answers by text-to-speech (TTS).
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ./check-dusk
|
||||||
|
.NOTES
|
||||||
|
Author: Markus Fleschutz · License: CC0
|
||||||
|
.LINK
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
#>
|
||||||
|
|
||||||
|
try {
|
||||||
|
$Reply = (Invoke-WebRequest http://wttr.in/?format="Dusk is 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
|
||||||
|
}
|
@ -1,10 +1,10 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Checks the moon
|
Checks the moon phase
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This script determines moon details and answers by text-to-speech (TTS).
|
This script determines the moon phase and answers by text-to-speech (TTS).
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./check-moon
|
PS> ./check-moon-phase
|
||||||
.NOTES
|
.NOTES
|
||||||
Author: Markus Fleschutz · License: CC0
|
Author: Markus Fleschutz · License: CC0
|
||||||
.LINK
|
.LINK
|
22
Scripts/check-sunrise.ps1
Normal file
22
Scripts/check-sunrise.ps1
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Checks the time of sunrise
|
||||||
|
.DESCRIPTION
|
||||||
|
This script queries the time of sunrise and answers by text-to-speech (TTS).
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ./check-sunrise
|
||||||
|
.NOTES
|
||||||
|
Author: Markus Fleschutz · License: CC0
|
||||||
|
.LINK
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
#>
|
||||||
|
|
||||||
|
try {
|
||||||
|
$Reply = (Invoke-WebRequest http://wttr.in/?format="Sunrise is at %S." -UserAgent "curl" -useBasicParsing).Content
|
||||||
|
"✔️ $Reply"
|
||||||
|
& "$PSScriptRoot/speak-english.ps1" "$Reply"
|
||||||
|
exit 0 # success
|
||||||
|
} catch {
|
||||||
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
exit 1
|
||||||
|
}
|
22
Scripts/check-sunset.ps1
Normal file
22
Scripts/check-sunset.ps1
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Checks the time of sunset
|
||||||
|
.DESCRIPTION
|
||||||
|
This script queries the time of sunset and answers by text-to-speech (TTS).
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ./check-sunset
|
||||||
|
.NOTES
|
||||||
|
Author: Markus Fleschutz · License: CC0
|
||||||
|
.LINK
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
#>
|
||||||
|
|
||||||
|
try {
|
||||||
|
$Reply = (Invoke-WebRequest http://wttr.in/?format="Sunset is at %s." -UserAgent "curl" -useBasicParsing).Content
|
||||||
|
"✔️ $Reply"
|
||||||
|
& "$PSScriptRoot/speak-english.ps1" "$Reply"
|
||||||
|
exit 0 # success
|
||||||
|
} catch {
|
||||||
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
exit 1
|
||||||
|
}
|
22
Scripts/check-zenith.ps1
Normal file
22
Scripts/check-zenith.ps1
Normal 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
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user