mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-15 04:24:01 +01:00
Add check-time-zone.ps1
This commit is contained in:
parent
5e38219fe7
commit
91566b318b
@ -16,10 +16,10 @@ try {
|
||||
[system.threading.thread]::currentThread.currentCulture = [system.globalization.cultureInfo]"en-US"
|
||||
$Time = $((Get-Date).ToShortTimeString())
|
||||
$TZ = (Get-Timezone)
|
||||
if ($TZ.SupportsDaylightSavingTime) { $DST="+ 01:00:00 daylight saving time" } else { $DST="" }
|
||||
Write-Host "✅ $Time (UTC + $($TZ.BaseUtcOffset) $($TZ.Id) $DST)"
|
||||
if ($TZ.SupportsDaylightSavingTime) { $DST=", DST+1h" } else { $DST="" }
|
||||
Write-Host "✅ $Time $($TZ.Id) time (TZ+$($TZ.BaseUtcOffset)$($DST))"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user