Updated check-time-zone.ps1

This commit is contained in:
Markus Fleschutz 2024-08-17 13:27:44 +02:00
parent 57342553e8
commit 010f4937a1

View File

@ -5,7 +5,7 @@
This PowerShell script queries the local time zone and prints it. This PowerShell script queries the local time zone and prints it.
.EXAMPLE .EXAMPLE
PS> ./check-time-zone.ps1 PS> ./check-time-zone.ps1
3:27 PM in W. Europe Summer Time (UTC+01:00:00 +1h DST) 3:27 PM West Europe Summer Time (UTC+01:00:00 +1h DST)
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -24,7 +24,7 @@ try {
$TZName = $TZ.StandardName $TZName = $TZ.StandardName
$DST="" $DST=""
} }
Write-Host "$Time in $TZName (UTC+$($offset)$($DST))" Write-Host "$Time $TZName (UTC+$($offset)$($DST))"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"