Skip to content
This repository was archived by the owner on May 15, 2018. It is now read-only.
This repository was archived by the owner on May 15, 2018. It is now read-only.

Set doesn't merge an existing resource #1

@craig-martin

Description

@craig-martin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions