Skip to content

Commit c1d782c

Browse files
committed
Fix deletion of scheduled task with unknown or empty task trigger
1 parent 39b261e commit c1d782c

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- Fix master branch AppVeyor badge link URL in README.MD - See [Issue #140](https://github.com/PowerShell/xComputerManagement/issues/140).
6+
- Fix deletion of scheduled task with unknown or empty task trigger. Get-TargetResource returns an empty ScheduleType string if the task trigger is empty or unknown - See [Issue #137](https://github.com/PowerShell/xComputerManagement/issues/137)
67

78
## 4.0.0.0
89

Modules/xComputerManagement/DSCResources/MSFT_xScheduledTask/MSFT_xScheduledTask.psm1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,7 @@ function Get-TargetResource
438438

439439
default
440440
{
441-
New-InvalidArgumentException `
442-
-Message ($script:localizedData.TriggerTypeError -f $trigger.CimClass.CimClassName) `
443-
-ArgumentName CimClassName
441+
$returnScheduleType = ''
444442
}
445443
}
446444

0 commit comments

Comments
 (0)