mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 05:04:39 +02:00
Rename to check-date.ps1 and check-time.ps1
This commit is contained in:
@ -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))"
|
@ -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))"
|
Reference in New Issue
Block a user