Rename to write-time.ps1

This commit is contained in:
Markus Fleschutz
2022-09-10 14:16:14 +02:00
parent f14196edf8
commit 47c2254882

22
Scripts/write-time.ps1 Executable file
View File

@ -0,0 +1,22 @@
<#
.SYNOPSIS
Writes the current time
.DESCRIPTION
This PowerShell script determines and writes the current time.
.EXAMPLE
PS> ./write-time
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
try {
[system.threading.thread]::currentThread.currentCulture = [system.globalization.cultureInfo]"en-US"
$CurrentTime = $((Get-Date).ToShortTimeString())
"🕒$CurrentTime"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}