Add hi.ps1 and check-my-balance.ps1

This commit is contained in:
Markus Fleschutz 2021-12-04 13:39:59 +01:00
parent 4e5cd0a94e
commit 0f4b7a68a7
3 changed files with 46 additions and 1 deletions

View File

@ -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`

View File

@ -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
}

22
Scripts/hi.ps1 Normal file
View File

@ -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
}