Update check-time-zone.ps1 and check-uptime.ps1

This commit is contained in:
Markus Fleschutz
2023-01-08 09:56:44 +01:00
parent f7d812618b
commit 4db1c30d76
2 changed files with 13 additions and 12 deletions

View File

@ -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])"