Add good-bye.ps1

This commit is contained in:
Markus Fleschutz 2021-11-26 14:46:14 +01:00
parent d7cb9342f0
commit 395bc98718
6 changed files with 40 additions and 30 deletions

View File

@ -110,3 +110,4 @@ Nice Conversation
* *Computer, good night.*
* *Computer, how are you?*
* *Computer, thank you.*
* *Computer, good bye.*

18
Scripts/good-bye.ps1 Normal file
View File

@ -0,0 +1,18 @@
<#
.SYNOPSIS
Say an answer to 'good bye'
.DESCRIPTION
This script answers to "good bye" by text-to-speech (TTS).
.EXAMPLE
PS> ./good-bye
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
https://github.com/fleschutz/PowerShell
#>
$Answer = "Good bye.", "See you." | Get-Random
write-output "$Answer"
& "$PSScriptRoot/speak-english.ps1" "$Answer"
exit 0 # success

View File

@ -11,10 +11,8 @@
https://github.com/fleschutz/PowerShell
#>
try {
& "$PSScriptRoot/speak-english.ps1" "And a special good evening to you too"
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1
}
$Answer = "And a special good evening to you too."
write-output "$Answer"
& "$PSScriptRoot/speak-english.ps1" "$Answer"
exit 0 # success

View File

@ -11,10 +11,8 @@
https://github.com/fleschutz/PowerShell
#>
try {
& "$PSScriptRoot/speak-english.ps1" "Well, good morning to you too"
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1
}
$Answer = "Well, good morning to you too."
write-output "$Answer"
& "$PSScriptRoot/speak-english.ps1" "$Answer"
exit 0 # success

View File

@ -1,6 +1,6 @@
<#
.SYNOPSIS
Answers to 'good night'
Say an answer to 'good night'
.DESCRIPTION
This script answers to "good night" by text-to-speech (TTS).
.EXAMPLE
@ -11,11 +11,8 @@
https://github.com/fleschutz/PowerShell
#>
try {
$Answer = "Good night to you, too.", "Good night to you, my friend.", "Have a good night. Sleep well.", "Good night and sweet dreams." | Get-Random
& "$PSScriptRoot/speak-english.ps1" "$Answer"
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1
}
$Answer = "Good night to you, too.", "Good night to you, my friend.", "Have a good night. Sleep well.", "Good night and sweet dreams." | Get-Random
write-output "$Answer"
& "$PSScriptRoot/speak-english.ps1" "$Answer"
exit 0 # success

View File

@ -11,10 +11,8 @@
https://github.com/fleschutz/PowerShell
#>
try {
& "$PSScriptRoot/speak-english.ps1" "It's a pleasure."
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
exit 1
}
$Answer = "It's a pleasure.", "Never mind." | Get-Random
write-output "$Answer"
& "$PSScriptRoot/speak-english.ps1" "$Answer"
exit 0 # success