mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-26 09:53:57 +01:00
Update check-time-zone.ps1 and list-timezone.ps1
This commit is contained in:
parent
742c44d8aa
commit
e29b6db89a
@ -12,9 +12,11 @@
|
||||
#>
|
||||
|
||||
try {
|
||||
$TimeZone = (Get-Timezone)
|
||||
|
||||
"✅ Time zone is $($TimeZone.DisplayName)."
|
||||
[system.threading.thread]::currentThread.currentCulture = [system.globalization.cultureInfo]"en-US"
|
||||
$Time = $((Get-Date).ToShortTimeString())
|
||||
$TZ = (Get-Timezone)
|
||||
if ($TZ.SupportsDaylightSavingTime) { $DST="+01DST" } else { $DST="" }
|
||||
"✅ $Time $($TZ.Id) (UTC+$($TZ.BaseUtcOffset) $DST)."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists the details of the current time zone
|
||||
Lists time zone details
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists the details of the current time zone.
|
||||
.EXAMPLE
|
||||
@ -19,7 +19,8 @@
|
||||
#>
|
||||
|
||||
try {
|
||||
get-timezone
|
||||
[system.threading.thread]::currentThread.currentCulture = [system.globalization.cultureInfo]"en-US"
|
||||
Get-Timezone
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user