From a959f51ce6323c4e9e35ce27c1481f4a7a8d60b9 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Wed, 1 Dec 2021 11:53:01 +0100 Subject: [PATCH] Rename to check-date.ps1 and check-time.ps1 --- Docs/VoiceControl.md | 2 +- README.md | 2 -- Scripts/{say-date.ps1 => check-date.ps1} | 14 +++++++------- Scripts/{say-time.ps1 => check-time.ps1} | 13 ++++++------- 4 files changed, 14 insertions(+), 17 deletions(-) rename Scripts/{say-date.ps1 => check-date.ps1} (63%) rename Scripts/{say-time.ps1 => check-time.ps1} (64%) diff --git a/Docs/VoiceControl.md b/Docs/VoiceControl.md index 05c06264..f4f34510 100644 --- a/Docs/VoiceControl.md +++ b/Docs/VoiceControl.md @@ -97,7 +97,7 @@ Computer, open `name` settings Computer, check `name` ---------------------- * let the computer check something. -* replace `name` by: "CPU", "DNS", "operating system", "ping", "swap space", or "up-time". +* replace `name` by: "CPU", "date", "DNS", "operating system", "ping", "swap space", "time", or "up-time". 🔊 Audio diff --git a/README.md b/README.md index edd99483..8090d83c 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,6 @@ Mega Collection of PowerShell Scripts | [play-mp3.ps1](Scripts/play-mp3.ps1) | Plays the given sound file (MP3 file format) | [Help](Docs/play-mp3.md) | | [play-super-mario.ps1](Scripts/play-super-mario.ps1) | Plays the Super Mario Intro | [Help](Docs/play-super-mario.md) | | [play-tetris-melody.ps1](Scripts/play-tetris-melody.ps1) | Plays the Tetris melody | [Help](Docs/play-tetris-melody.md) | -| [say-date.ps1](Scripts/say-date.ps1) | Say the current date by text-to-speech | [Help](Docs/say-date.md) | -| [say-time.ps1](Scripts/say-time.ps1) | Say the current time by text-to-speech | [Help](Docs/say-time.md) | | [speak-checklist.ps1](Scripts/speak-checklist.ps1) | Speaks the given checklist by text-to-speech | [Help](Docs/speak-checklist.md) | | [speak-countdown.ps1](Scripts/speak-countdown.ps1) | Starts a countdown by text-to-speech | [Help](Docs/speak-countdown.md) | | [speak-english.ps1](Scripts/speak-english.ps1) | Speaks the given text with an English text-to-speech voice | [Help](Docs/speak-english.md) | diff --git a/Scripts/say-date.ps1 b/Scripts/check-date.ps1 similarity index 63% rename from Scripts/say-date.ps1 rename to Scripts/check-date.ps1 index cf99e401..383bd99a 100755 --- a/Scripts/say-date.ps1 +++ b/Scripts/check-date.ps1 @@ -1,11 +1,11 @@ <# .SYNOPSIS - Say the current date by text-to-speech + Determines the current date .DESCRIPTION - This script speaks the current date by text-to-speech (TTS). + This script determines and speaks the current date by text-to-speech (TTS). .EXAMPLE - PS> ./say-date - (It's Sunday, October 17, 2021) + PS> ./check-date + ✔️ It's Sunday, October 17, 2021 .NOTES Author: Markus Fleschutz · License: CC0 .LINK @@ -16,9 +16,9 @@ try { [system.threading.thread]::currentthread.currentculture=[system.globalization.cultureinfo]"en-US" $Weekday = (Get-Date -format "dddd") $CurrentDate = (Get-Date).ToShortDateString() - $Answer = "It's $Weekday, $CurrentDate" - & "$PSScriptRoot/speak-english.ps1" "$Answer" - write-output "$Answer" + $Reply = "It's $Weekday, $CurrentDate" + "✔️ $Reply" + & "$PSScriptRoot/speak-english.ps1" "$Reply" exit 0 # success } catch { "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" diff --git a/Scripts/say-time.ps1 b/Scripts/check-time.ps1 similarity index 64% rename from Scripts/say-time.ps1 rename to Scripts/check-time.ps1 index 1f643a87..f9d7f43e 100755 --- a/Scripts/say-time.ps1 +++ b/Scripts/check-time.ps1 @@ -1,11 +1,10 @@ <# .SYNOPSIS - Say the current time by text-to-speech + Determines the current time .DESCRIPTION - This script speaks the current time by text-to-speech (TTS). + This script determines and speaks the current time by text-to-speech (TTS). .EXAMPLE - PS> ./say-time - (It's 2:23 PM) + PS> ./check-time .NOTES Author: Markus Fleschutz · License: CC0 .LINK @@ -15,9 +14,9 @@ try { [system.threading.thread]::currentThread.currentCulture=[system.globalization.cultureInfo]"en-US" $CurrentTime = $((Get-Date).ToShortTimeString()) - $Answer = "It's $CurrentTime" - & "$PSScriptRoot/speak-english.ps1" "$Answer" - write-output "$Answer" + $Reply = "It's $CurrentTime" + "✔️ $Reply" + & "$PSScriptRoot/speak-english.ps1" "$Reply" exit 0 # success } catch { "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"