Skip to content

Commit e1ba5ff

Browse files
committed
Finished changes as per PR comments
1 parent 549476d commit e1ba5ff

4 files changed

Lines changed: 21 additions & 5 deletions

File tree

DSCResources/MSFT_xScheduledTask/MSFT_xScheduledTask.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ function Set-TargetResource
951951
New-InvalidArgumentException -Message $exceptionMessage -ArgumentName RepetitionDuration
952952
}
953953

954-
$temptriggerParameters = @{
954+
$tempTriggerParameters = @{
955955
Once = $true
956956
At = '6:6:6'
957957
RepetitionInterval = $RepeatInterval

Examples/xScheduledTask/4-CreateScheduledTasksWeekly.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
.EXAMPLE
33
This example creates a scheduled task called 'Test task Weekly' in the folder
44
task folder 'MyTasks' that starts a new powershell process every week on
5-
Mon, Wed, Sat at 00:00 repeating every 15 minutes for 8 hours. The task will
6-
be hidden and will be allowed to start if the machine is running on batteries.
7-
The task will be compatible with Windows 8.
5+
Monday, Wednesday and Saturday at 00:00 repeating every 15 minutes for 8 hours.
6+
The task will be hidden and will be allowed to start if the machine is running
7+
on batteries. The task will be compatible with Windows 8.
88
#>
99
Configuration Example
1010
{

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ xScheduledTask has the following properties:
170170
* [Create a task that starts PowerShell once every 15 minutes from 00:00 for 8 hours](/Examples/xScheduledTask/1-CreateScheduledTaskOnce.ps1)
171171
* [Create a task that starts PowerShell daily every 15 minutes from 00:00 for 8 hours](/Examples/xScheduledTask/2-CreateScheduledTaskDaily.ps1)
172172
* [Create a task that starts PowerShell daily every 15 minutes from 00:00 indefinitely](/Examples/xScheduledTask/3-CreateScheduledTasksDailyIndefinitely.ps1)
173-
* [Create a task that starts PowerShell weekly on Mon, Wed, Sat every 15 minutes from 00:00 for 8 hours](/Examples/xScheduledTask/4-CreateScheduledTasksWeekly.ps1)
173+
* [Create a task that starts PowerShell weekly on Monday, Wednesday and Saturday every 15 minutes from 00:00 for 8 hours](/Examples/xScheduledTask/4-CreateScheduledTasksWeekly.ps1)
174174
* [Create a task that starts PowerShell at logon and runs every 15 minutes from 00:00 for 8 hours](/Examples/xScheduledTask/5-CreateScheduledTasksAtLogon.ps1)
175175
* [Create a task that starts PowerShell at startup and runs every 15 minutes from 00:00 for 8 hours](/Examples/xScheduledTask/6-CreateScheduledTasksAtStartup.ps1)
176176
* [Run a PowerShell script every 15 minutes for 4 days on a server](/Examples/xScheduledTask/7-RunPowerShellTaskEvery15Minutes.ps1)

Tests/Integration/MSFT_xScheduledTask.Integration.Tests.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,22 @@ try
134134
(Test-DscConfiguration -ReferenceConfiguration $ConfigMof -Verbose).InDesiredState | Should be $true
135135
}
136136

137+
It 'Should have set the resource and all the parameters should match' {
138+
$current = Get-DscConfiguration | Where-Object {$_.ConfigurationName -eq $CurrentConfig}
139+
$current.TaskName | Should Be 'Test task once cross timezone'
140+
$current.TaskPath | Should Be '\xComputerManagement\'
141+
$current.ActionExecutable | Should Be 'C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe'
142+
$current.ScheduleType | Should Be 'Once'
143+
$current.RepeatInterval | Should Be '00:15:00'
144+
$current.RepetitionDuration | Should Be '23:00:00'
145+
$current.ActionWorkingPath | Should Be (Get-Location).Path
146+
$current.Enable | Should Be $true
147+
$current.RandomDelay | Should Be '01:00:00'
148+
$current.DisallowHardTerminate | Should Be $true
149+
$current.RunOnlyIfIdle | Should Be $false
150+
$current.Priority | Should Be 9
151+
}
152+
137153
AfterAll {
138154
Set-TimeZoneId -Id $currentTimeZoneId
139155
}

0 commit comments

Comments
 (0)