From 0f4b7a68a7d05e8b34c1d0260d058ea003c2e19a Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Sat, 4 Dec 2021 13:39:59 +0100 Subject: [PATCH] Add hi.ps1 and check-my-balance.ps1 --- Docs/VoiceControl.md | 3 ++- Scripts/check-my-balance.ps1 | 22 ++++++++++++++++++++++ Scripts/hi.ps1 | 22 ++++++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 Scripts/check-my-balance.ps1 create mode 100644 Scripts/hi.ps1 diff --git a/Docs/VoiceControl.md b/Docs/VoiceControl.md index 39f849e9..f9a27727 100644 --- a/Docs/VoiceControl.md +++ b/Docs/VoiceControl.md @@ -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), `my balance` (fun), `operating system`, `ping`, `swap space`, `time`, `time zone`, `up-time`, `VPN`, or `weather`. `Computer, open` [name] `browser` --------------------------------- @@ -103,6 +103,7 @@ More supported voice commands are: 💬 Conversation Commands ------------------------- +* `Computer, Hi` * `Computer, good morning` * `Computer, good evening` * `Computer, good night` diff --git a/Scripts/check-my-balance.ps1 b/Scripts/check-my-balance.ps1 new file mode 100644 index 00000000..7402284f --- /dev/null +++ b/Scripts/check-my-balance.ps1 @@ -0,0 +1,22 @@ +<# +.SYNOPSIS + Checks the balance (fun) +.DESCRIPTION + This script checks the balance and replies by text-to-speech (TTS). +.EXAMPLE + PS> ./check-my-balance +.NOTES + Author: Markus Fleschutz · License: CC0 +.LINK + https://github.com/fleschutz/PowerShell +#> + +try { + $Reply = "OK, what's your account number?" + "✔️ $Reply" + & "$PSScriptRoot/speak-english.ps1" "$Reply" + exit 0 # success +} catch { + "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" + exit 1 +} diff --git a/Scripts/hi.ps1 b/Scripts/hi.ps1 new file mode 100644 index 00000000..523887f3 --- /dev/null +++ b/Scripts/hi.ps1 @@ -0,0 +1,22 @@ +<# +.SYNOPSIS + Replies to "Hi" +.DESCRIPTION + This script replies to "Hi" by text-to-speech (TTS). +.EXAMPLE + PS> ./hi +.NOTES + Author: Markus Fleschutz · License: CC0 +.LINK + https://github.com/fleschutz/PowerShell +#> + +try { + $Reply = "Hello, how can I help?" + "✔️ $Reply" + & "$PSScriptRoot/speak-english.ps1" "$Reply" + exit 0 # success +} catch { + "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" + exit 1 +}