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

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