-
Notifications
You must be signed in to change notification settings - Fork 83
Closed
Labels
bugThe issue is a bug.The issue is a bug.help wantedThe issue is up for grabs for anyone in the community.The issue is up for grabs for anyone in the community.
Description
It seems that scheduled tasks with a daily schedule get deleted and recreated every day, on the first DSC run after midnight. It appears to me that the date in the daily trigger is compared to the current date.
You can reproduce this by creating a task with a daily trigger, then manually change the date in the daily trigger, and Test-DscConfiguration will return False, setting the date back to the current date will result in Test-DscConfiguration returning True.
Is this expected? Seems to me that the date on the daily trigger should not matter if it is the current date or earlier.
Configuration:
xScheduledTask 'mytask'
{
Ensure = 'Present'
TaskName = 'mytask'
Description = 'Collect system information'
ActionExecutable = 'c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe'
ActionArguments = '-NonInteractive -File c:\scripts\mytask.ps1 -output c:\temp\mytask\ -rsync -compress -verbose'
ActionWorkingPath = 'c:\scripts'
ScheduleType = 'Daily'
DaysInterval = 1
StartTime = '23:30:00'
RandomDelay = '01:00:00'
ExecutionTimeLimit = '06:00:00'
Enable = $true
MultipleInstances = 'IgnoreNew'
Priority = 9
Compatibility = 'Win8'
}
Windows version: Server 2016, 10.0.14393.0
PowerShell version:
>$PSVersionTable
Name Value
---- -----
PSVersion 5.1.14393.2068
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0, 5.0, 5.1.14393.2068}
BuildVersion 10.0.14393.2068
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
DSC module version: 4.0.0.0
OffColour
Metadata
Metadata
Assignees
Labels
bugThe issue is a bug.The issue is a bug.help wantedThe issue is up for grabs for anyone in the community.The issue is up for grabs for anyone in the community.