mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-17 16:11:22 +02:00
Update say-time.ps1 and say-date.ps1
This commit is contained in:
@ -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))"
|
||||
|
@ -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))"
|
||||
|
Reference in New Issue
Block a user