mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-26 09:53:57 +01:00
Add good-bye.ps1
This commit is contained in:
parent
d7cb9342f0
commit
395bc98718
@ -110,3 +110,4 @@ Nice Conversation
|
|||||||
* *Computer, good night.*
|
* *Computer, good night.*
|
||||||
* *Computer, how are you?*
|
* *Computer, how are you?*
|
||||||
* *Computer, thank you.*
|
* *Computer, thank you.*
|
||||||
|
* *Computer, good bye.*
|
||||||
|
18
Scripts/good-bye.ps1
Normal file
18
Scripts/good-bye.ps1
Normal 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
|
@ -11,10 +11,8 @@
|
|||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
#>
|
#>
|
||||||
|
|
||||||
try {
|
$Answer = "And a special good evening to you too."
|
||||||
& "$PSScriptRoot/speak-english.ps1" "And a special good evening to you too"
|
|
||||||
exit 0 # success
|
write-output "$Answer"
|
||||||
} catch {
|
& "$PSScriptRoot/speak-english.ps1" "$Answer"
|
||||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
exit 0 # success
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
@ -11,10 +11,8 @@
|
|||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
#>
|
#>
|
||||||
|
|
||||||
try {
|
$Answer = "Well, good morning to you too."
|
||||||
& "$PSScriptRoot/speak-english.ps1" "Well, good morning to you too"
|
|
||||||
exit 0 # success
|
write-output "$Answer"
|
||||||
} catch {
|
& "$PSScriptRoot/speak-english.ps1" "$Answer"
|
||||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
exit 0 # success
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Answers to 'good night'
|
Say an answer to 'good night'
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This script answers to "good night" by text-to-speech (TTS).
|
This script answers to "good night" by text-to-speech (TTS).
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
@ -11,11 +11,8 @@
|
|||||||
https://github.com/fleschutz/PowerShell
|
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
|
||||||
$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"
|
write-output "$Answer"
|
||||||
exit 0 # success
|
& "$PSScriptRoot/speak-english.ps1" "$Answer"
|
||||||
} catch {
|
exit 0 # success
|
||||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
@ -11,10 +11,8 @@
|
|||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
#>
|
#>
|
||||||
|
|
||||||
try {
|
$Answer = "It's a pleasure.", "Never mind." | Get-Random
|
||||||
& "$PSScriptRoot/speak-english.ps1" "It's a pleasure."
|
|
||||||
exit 0 # success
|
write-output "$Answer"
|
||||||
} catch {
|
& "$PSScriptRoot/speak-english.ps1" "$Answer"
|
||||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
exit 0 # success
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user