mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-12 06:02:56 +02:00
Update check-time-zone.ps1 and check-uptime.ps1
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the time zone setting
|
||||
Checks the time zone
|
||||
.DESCRIPTION
|
||||
This PowerShell script determines and prints the current time zone.
|
||||
This PowerShell script queries the user's time zone and prints it.
|
||||
.EXAMPLE
|
||||
PS> ./check-time-zone
|
||||
.LINK
|
||||
@ -16,7 +16,7 @@ try {
|
||||
$Time = $((Get-Date).ToShortTimeString())
|
||||
$TZ = (Get-Timezone)
|
||||
if ($TZ.SupportsDaylightSavingTime) { $DST=" & +01:00:00 DST" } else { $DST="" }
|
||||
"✅ $Time in $($TZ.Id) (UTC+$($TZ.BaseUtcOffset)$DST)."
|
||||
Write-Host "✅ $Time in $($TZ.Id) (UTC+$($TZ.BaseUtcOffset)$DST)."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Reference in New Issue
Block a user