mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-30 20:50:02 +02:00
Add check-day.ps1
This commit is contained in:
23
Scripts/check-day.ps1
Normal file
23
Scripts/check-day.ps1
Normal 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
|
||||
}
|
Reference in New Issue
Block a user