Add check-day.ps1

This commit is contained in:
Markus 2021-12-11 17:48:35 +01:00
parent 42aab1440b
commit 9259ab452a
2 changed files with 24 additions and 1 deletions

View File

@ -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."*

23
Scripts/check-day.ps1 Normal file
View File

@ -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
}