-
Notifications
You must be signed in to change notification settings - Fork 82
TimeZone
OffColour edited this page Aug 22, 2018
·
11 revisions
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
| TimeZone | Key | String | The desired time zone. | |
| IsSingleInstance | Write | String | Specifies if the resource is a single instance | Yes |
The resource will use the Get-TimeZone cmdlet to get the current time zone. If Get-TimeZone is not available them CIM will be used to retrieve the current time zone. To update the time zone, .NET reflection will be used to update the time zone if required. If .NET reflection is not supported on the node (in the case of Nano Server) then tzutil.exe will be used to set the time zone.
To discover all valid time zones for this property, use this PowerShell command: [System.TimeZoneInfo]::GetSystemTimeZones().Id
List of time zone values here.
This example sets the current time zone on the node to 'Tonga Standard Time'.
Configuration Example
{
param
(
[Parameter()]
[System.String[]]
$NodeName = 'localhost'
)
Import-DSCResource -ModuleName ComputerManagementDsc
Node $NodeName
{
xTimeZone TimeZoneExample
{
IsSingleInstance = 'Yes'
TimeZone = 'Tonga Standard Time'
}
}
}- Computer
- IEEnhancedSecurityConfiguration
- OfflineDomainJoin
- PendingReboot
- PowerPlan
- PowerShellExecutionPolicy
- PSResourceRepository
- RemoteDesktopAdmin
- ScheduledTask
- SmbServerConfiguration
- SmbShare
- SystemLocale
- SystemProtection
- SystemRestorePoint
- TimeZone
- UserAccountControl
- VirtualMemory
- WindowsCapability
- WindowsEventLog