Examples/Resources/ScheduledTask/15-CreateScheduledTaskOnceSynchronizeAcrossTimeZoneEnabled.ps1

<#
    .EXAMPLE
    This example creates a scheduled task called 'Test task sync across time zone enabled'
    in the folder 'MyTasks' that starts a new powershell process once 2018-10-01 01:00
    The task will have the option Synchronize across time zone enabled.
#>

Configuration Example
{
    param
    (
        [Parameter()]
        [System.String[]]
        $NodeName = 'localhost'
    )

    Import-DscResource -ModuleName ComputerManagementDsc

    Node $NodeName
    {
        ScheduledTask ScheduledTaskOnceSynchronizeAcrossTimeZoneEnabled
        {
            TaskName                  = 'Test task sync across time zone enabled'
            TaskPath                  = '\MyTasks\'
            ActionExecutable          = 'C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe'
            ScheduleType              = 'Once'
            StartTime                 = '2018-10-01T01:00:00'
            SynchronizeAcrossTimeZone = $true
            ActionWorkingPath         = (Get-Location).Path
            Enable                    = $true
        }
    }
}