From 9259ab452a4f29298cc81a613d90703d6deac804 Mon Sep 17 00:00:00 2001 From: Markus Date: Sat, 11 Dec 2021 17:48:35 +0100 Subject: [PATCH] Add check-day.ps1 --- Docs/VoiceControl.md | 2 +- Scripts/check-day.ps1 | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 Scripts/check-day.ps1 diff --git a/Docs/VoiceControl.md b/Docs/VoiceControl.md index 788d278c..58231ca7 100644 --- a/Docs/VoiceControl.md +++ b/Docs/VoiceControl.md @@ -32,7 +32,7 @@ When finished say: *"Computer, close [app]"* to close the application. *"Computer, check [item]."* -------------------------- -Lets the computer check something, replace [item] by: `Bitcoin rate`, `Christmas`, `CPU`, `date`, `dawn`, `DNS`, `drives`, `dusk`, `Easter Sunday`, `Earth` (fun), `Ether rate`, `headlines`, `Independence Day`, `ISS position`, `midnight`, `moon phase`, `New Year`, `noon`, `operating system`, `ping`, `Santa`, `sunrise`, `sunset`, `swap space`, `tea time`, `Tether rate`, `time`, `time zone`, `up-time`, `VPN`, `weather`, `week`, `year`, or `zenith`. +Lets the computer check something, replace [item] by: `Bitcoin rate`, `Christmas`, `CPU`, `date`, `dawn`, `day`, `DNS`, `drives`, `dusk`, `Easter Sunday`, `Earth` (fun), `Ether rate`, `headlines`, `Independence Day`, `ISS position`, `midnight`, `moon phase`, `New Year`, `noon`, `operating system`, `ping`, `Santa`, `sunrise`, `sunset`, `swap space`, `tea time`, `Tether rate`, `time`, `time zone`, `up-time`, `VPN`, `weather`, `week`, `year`, or `zenith`. *"Computer, open [letter] drive."* diff --git a/Scripts/check-day.ps1 b/Scripts/check-day.ps1 new file mode 100644 index 00000000..8776863e --- /dev/null +++ b/Scripts/check-day.ps1 @@ -0,0 +1,23 @@ +<# +.SYNOPSIS + Determines the current day +.DESCRIPTION + This script determines and speaks the current day by text-to-speech (TTS). +.EXAMPLE + PS> ./check-day + ✔️ It's Sunday. +.NOTES + Author: Markus Fleschutz · License: CC0 +.LINK + https://github.com/fleschutz/PowerShell +#> + +try { + [system.threading.thread]::currentthread.currentculture=[system.globalization.cultureinfo]"en-US" + $Weekday = (Get-Date -format "dddd") + & "$PSScriptRoot/give-reply.ps1" "It's $Weekday." + exit 0 # success +} catch { + "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" + exit 1 +}