Closed craig-martin closed 9 years ago
Looks like the Set-TargetResource method isn't handling an existing scheduled task. Here's the repro, run directly instead of through the LCM:
ipmo 'C:\Program Files\WindowsPowerShell\Modules\StackExchangeResources\DSCResources\StackExchange_ScheduledTask' -Force $testResourceProperties = @{ Name = 'testTask' FilePath = 'C:\Temp\foo.ps1' At = [DateTime]::Now.ToString() Hours = 1 Daily = $true Ensure = 'Present' } ### Expect this to create the task: SUCCESS Set-TargetResource @testResourceProperties -Verbose:$true ### Expect this to update the task: FAIL (Register-ScheduledJob : The scheduled job definition FIM Sync Daily Delta already exists in the job definition store.) Set-TargetResource @testResourceProperties -Verbose:$true
Fixed by #2 .
Looks like the Set-TargetResource method isn't handling an existing scheduled task. Here's the repro, run directly instead of through the LCM: