Created
June 28, 2016 16:43
-
-
Save guitarrapc/055acdd7a3a5d9c85a9bead504b43747 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-TimeZone | |
{ | |
[CmdletBinding()] | |
param() | |
Write-Verbose -Message ($LocalizedData.GettingTimezoneCimMessage) | |
$TimeZone = (Get-CimInstance ` | |
-ClassName WIN32_Timezone ` | |
-Namespace root\cimv2).StandardName | |
Write-Verbose -Message ($LocalizedData.CurrentTimezoneMessage ` | |
-f $Timezone) | |
return $TimeZone | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-TimeZoneId | |
{ | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory = $true)] | |
[System.String] | |
$TimeZone | |
) | |
# Convert TimeZone Standard Name to TimeZone Id | |
$timeZoneInfo = [System.TimeZoneInfo]::GetSystemTimeZones() | | |
Where-Object StandardName -eq $TimeZone | |
return $timeZoneInfo.Id | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment