Update say-time.ps1 and say-date.ps1

This commit is contained in:
Markus Fleschutz
2021-10-17 14:30:21 +02:00
parent bd616fd925
commit 4b32817170
268 changed files with 8 additions and 3 deletions

View File

@ -5,6 +5,7 @@
This script speaks the current date by text-to-speech (TTS).
.EXAMPLE
PS> ./say-date
(It's Sunday, October 17, 2021)
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
@ -13,7 +14,9 @@
try {
[system.threading.thread]::currentthread.currentculture=[system.globalization.cultureinfo]"en-US"
& "$PSScriptRoot/speak-english.ps1" "Today is $((Get-Date).ToShortDateString())"
$Weekday = (Get-Date -format "dddd")
$CurrentDate = (Get-Date).ToShortDateString()
& "$PSScriptRoot/speak-english.ps1" "It's $Weekday, $CurrentDate"
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"

View File

@ -5,6 +5,7 @@
This script speaks the current time by text-to-speech (TTS).
.EXAMPLE
PS> ./say-time
(It's 2:23 PM)
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
@ -12,8 +13,9 @@
#>
try {
[system.threading.thread]::currentthread.currentculture=[system.globalization.cultureinfo]"en-US"
& "$PSScriptRoot/speak-english.ps1" "It's now $((Get-Date).ToShortTimeString())"
[system.threading.thread]::currentThread.currentCulture=[system.globalization.cultureInfo]"en-US"
$CurrentTime = $((Get-Date).ToShortTimeString())
& "$PSScriptRoot/speak-english.ps1" "It's $CurrentTime"
exit 0 # success
} catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"