From 36938724dcf1ee203bd8f8c8fa5780b689edd2c2 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Wed, 24 Nov 2021 13:36:36 +0100 Subject: [PATCH] Update good-night.ps1 --- Scripts/good-night.ps1 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Scripts/good-night.ps1 b/Scripts/good-night.ps1 index 691abac6..09cecb9c 100644 --- a/Scripts/good-night.ps1 +++ b/Scripts/good-night.ps1 @@ -1,8 +1,8 @@ <# .SYNOPSIS - Say an answer to 'good night' + Answers to 'good night' .DESCRIPTION - This script answers "good night" by text-to-speech (TTS). + This script answers to "good night" by text-to-speech (TTS). .EXAMPLE PS> ./good-night .NOTES @@ -12,7 +12,14 @@ #> try { - & "$PSScriptRoot/speak-english.ps1" "Good night to you, my friend." + $Generator = New-Object System.Random + $Answer = switch([int]$Generator.next(0, 3)) { + 0 { "Good night to you, too." } + 1 { "Good night to you, my friend." } + 2 { "Have a good night. Sleep well." } + 3 { "Good night and sweet dreams." } + } + & "$PSScriptRoot/speak-english.ps1" "$Answer" exit 0 # success } catch { "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"