mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-26 01:43:37 +01:00
Rename to write-date.ps1
This commit is contained in:
parent
64b95af3e0
commit
f14196edf8
@ -1,25 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Determines the current date
|
||||
.DESCRIPTION
|
||||
This PowerShell script determines and speaks the current date by text-to-speech (TTS).
|
||||
.EXAMPLE
|
||||
PS> ./check-date
|
||||
✔️ It's Sunday, October 17, 2021
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
[system.threading.thread]::currentthread.currentculture=[system.globalization.cultureinfo]"en-US"
|
||||
$Weekday = (Get-Date -format "dddd")
|
||||
$CurrentDate = (Get-Date).ToShortDateString()
|
||||
|
||||
& "$PSScriptRoot/give-reply.ps1" "It's $Weekday, $CurrentDate"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
23
Scripts/write-date.ps1
Executable file
23
Scripts/write-date.ps1
Executable file
@ -0,0 +1,23 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Writes the current date
|
||||
.DESCRIPTION
|
||||
This PowerShell script determines and writes the current date.
|
||||
.EXAMPLE
|
||||
PS> ./write-date
|
||||
Sunday, October 17, 2021
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
[system.threading.thread]::currentthread.currentculture = [system.globalization.cultureinfo]"en-US"
|
||||
$CurrentDate = (Get-Date).ToShortDateString()
|
||||
"📅$CurrentDate"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
Loading…
Reference in New Issue
Block a user