mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-26 03:35:49 +02:00
Updated the manuals
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
Script: *check-time-zone.ps1*
|
||||
========================
|
||||
|
||||
This PowerShell script queries the time zone and prints it.
|
||||
This PowerShell script queries the local time zone and prints it.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
@@ -17,7 +17,7 @@ Example
|
||||
-------
|
||||
```powershell
|
||||
PS> ./check-time-zone.ps1
|
||||
✅ 11:13 AM W. Europe Summer Time (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna (+01:00 DST)
|
||||
✅ 3:27 PM in W. Europe Summer Time (UTC+01:00:00 +1h DST)
|
||||
|
||||
```
|
||||
|
||||
@@ -36,10 +36,10 @@ Script Content
|
||||
.SYNOPSIS
|
||||
Checks the time zone
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries the time zone and prints it.
|
||||
This PowerShell script queries the local time zone and prints it.
|
||||
.EXAMPLE
|
||||
PS> ./check-time-zone.ps1
|
||||
✅ 11:13 AM W. Europe Summer Time (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna (+01:00 DST)
|
||||
✅ 3:27 PM in W. Europe Summer Time (UTC+01:00:00 +1h DST)
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@@ -50,14 +50,15 @@ try {
|
||||
[system.threading.thread]::currentThread.currentCulture = [system.globalization.cultureInfo]"en-US"
|
||||
$Time = $((Get-Date).ToShortTimeString())
|
||||
$TZ = (Get-Timezone)
|
||||
$offset = $TZ.BaseUtcOffset
|
||||
if ($TZ.SupportsDaylightSavingTime) {
|
||||
$TZName = $TZ.DaylightName
|
||||
$DST=" (+01:00 DST)"
|
||||
$DST=" +1h DST"
|
||||
} else {
|
||||
$TZName = $TZ.StandardName
|
||||
$DST=""
|
||||
}
|
||||
Write-Host "✅ $Time $TZName $($TZ.DisplayName)$($DST)"
|
||||
Write-Host "✅ $Time in $TZName (UTC+$($offset)$($DST))"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
@@ -65,4 +66,4 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-time-zone.ps1 as of 05/19/2024 10:25:18)*
|
||||
*(generated by convert-ps2md.ps1 using the comment-based help of check-time-zone.ps1 as of 08/15/2024 09:50:46)*
|
||||
|
Reference in New Issue
Block a user