mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-12 13:08:17 +02:00
Add check-*.ps1 scripts
This commit is contained in:
parent
5690484b39
commit
d977df7ce0
@ -23,9 +23,10 @@ More supported voice commands are:
|
|||||||
* launches the given application, just replace [app] by: `3D-Viewer`, `Calculator`, `Git Extensions`, `Microsoft Paint`, `Microsoft Store`, `Netflix`, `Notepad`, `OBS Studio`, `Outlook`, `Paint 3D`, `Spotify`, `Thunderbird`, `Visual Studio`, or `Windows Terminal`.
|
* launches the given application, just replace [app] by: `3D-Viewer`, `Calculator`, `Git Extensions`, `Microsoft Paint`, `Microsoft Store`, `Netflix`, `Notepad`, `OBS Studio`, `Outlook`, `Paint 3D`, `Spotify`, `Thunderbird`, `Visual Studio`, or `Windows Terminal`.
|
||||||
* when finished say: "Computer, close [app]" to close the application.
|
* when finished say: "Computer, close [app]" to close the application.
|
||||||
|
|
||||||
|
|
||||||
`Computer, check` [name]
|
`Computer, check` [name]
|
||||||
------------------------
|
------------------------
|
||||||
Lets the computer check something, replace [name] by: `Bitcoin`, `Christmas`, `CPU`, `date`, `DNS`, `dawn`, `drives`, `dusk`, `Earth` (fun), `headlines`, `ISS`, `moon phase`, `New Year`, `operating system`, `ping`, `sunrise`, `sunset`, `swap space`, `time`, `time zone`, `up-time`, `VPN`, `weather`, or `zenith`.
|
Lets the computer check something, replace [name] by: `Bitcoin`, `Christmas`, `CPU`, `date`, `dawn`, `DNS`, `Dogecoin`, `drives`, `dusk`, `Earth` (fun), `Ethereum`, `headlines`, `ISS`, `moon phase`, `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`
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$Rates = (Invoke-WebRequest -uri "https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD,EUR" -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json
|
$Rates = (Invoke-WebRequest -uri "https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=USD,EUR" -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json
|
||||||
$Reply = "Bitcoin is at $($Rates.USD) US$ and $($Rates.EUR) Euro."
|
$Reply = "Bitcoin is currently at $($Rates.USD) US$ and $($Rates.EUR) Euro."
|
||||||
"✔️ $Reply"
|
"✔️ $Reply"
|
||||||
& "$PSScriptRoot/speak-english.ps1" "$Reply"
|
& "$PSScriptRoot/speak-english.ps1" "$Reply"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
|
23
Scripts/check-dogecoin.ps1
Normal file
23
Scripts/check-dogecoin.ps1
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Checks the Dogecoin rate
|
||||||
|
.DESCRIPTION
|
||||||
|
This script queries the current Dogecoin exchange rates and answers by text-to-speech (TTS).
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ./check-dogecoin
|
||||||
|
.NOTES
|
||||||
|
Author: Markus Fleschutz · License: CC0
|
||||||
|
.LINK
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
#>
|
||||||
|
|
||||||
|
try {
|
||||||
|
$Rates = (Invoke-WebRequest -uri "https://min-api.cryptocompare.com/data/price?fsym=DOGE&tsyms=USD,EUR" -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json
|
||||||
|
$Reply = "Dogecoin is currently at $($Rates.USD) US$ and $($Rates.EUR) Euro."
|
||||||
|
"✔️ $Reply"
|
||||||
|
& "$PSScriptRoot/speak-english.ps1" "$Reply"
|
||||||
|
exit 0 # success
|
||||||
|
} catch {
|
||||||
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
exit 1
|
||||||
|
}
|
23
Scripts/check-ethereum.ps1
Normal file
23
Scripts/check-ethereum.ps1
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Checks the Ethereum rate
|
||||||
|
.DESCRIPTION
|
||||||
|
This script queries the current Ethereum exchange rates and answers by text-to-speech (TTS).
|
||||||
|
.EXAMPLE
|
||||||
|
PS> ./check-ethereum
|
||||||
|
.NOTES
|
||||||
|
Author: Markus Fleschutz · License: CC0
|
||||||
|
.LINK
|
||||||
|
https://github.com/fleschutz/PowerShell
|
||||||
|
#>
|
||||||
|
|
||||||
|
try {
|
||||||
|
$Rates = (Invoke-WebRequest -uri "https://min-api.cryptocompare.com/data/price?fsym=ETH&tsyms=USD,EUR" -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json
|
||||||
|
$Reply = "Ethereum is currently at $($Rates.USD) US$ and $($Rates.EUR) Euro."
|
||||||
|
"✔️ $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