mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 05:04:39 +02:00
Rename to write-time.ps1
This commit is contained in:
22
Scripts/write-time.ps1
Executable file
22
Scripts/write-time.ps1
Executable 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
|
||||
}
|
Reference in New Issue
Block a user