Skip to content

Commit 8ec8e4b

Browse files
authored
Merge pull request #36 from BrianFarnhill/bug-scheduletaskdailytime
Fixed bug with different OS versions returning repeat interval differently
2 parents 881326e + 7312308 commit 8ec8e4b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

DSCResources/MSFT_xScheduledTask/MSFT_xScheduledTask.psm1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ function Get-TargetResource
100100
$returnScheduleType = "Daily"
101101
[System.Uint32]$returnInveral = $repetition.Interval -replace "P" -replace "D"
102102
}
103+
if ($repetition.Duration -eq $null -and $repetition.Interval -like "P*D*")
104+
{
105+
$returnScheduleType = "Daily"
106+
[System.Uint32]$returnInveral = $repetition.Interval.Substring(0, $repetition.Interval.IndexOf('D')) -replace "P"
107+
}
103108
if (($repetition.Duration -eq "P1D" -or $repetition.Duration -eq $null) `
104109
-and $repetition.Interval -like "PT*H")
105110
{

0 commit comments

Comments
 (0)