File tree Expand file tree Collapse file tree
DSCResources/MSFT_xScheduledTask Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ function Get-TargetResource
6262 $repetition = $trigger.Repetition
6363 $returnScheduleType = " Unknown"
6464 $returnInveral = 0
65+ Write-Verbose - Message " Duration: '$ ( $repetition.Duration ) '"
66+ Write-Verbose - Message " Interval: '$ ( $repetition.Interval ) '"
6567 if ($repetition.Duration -eq $null -and $repetition.Interval -eq $null )
6668 {
6769 $returnScheduleType = " Daily"
Original file line number Diff line number Diff line change 1+ [Diagnostics.CodeAnalysis.SuppressMessageAttribute (" PSAvoidUsingConvertToSecureStringWithPlainText" , " " )]
2+ param (
3+ )
4+
15$Global :DSCModuleName = ' xComputerManagement'
26$Global :DSCResourceName = ' MSFT_xScheduledTask'
37
@@ -332,15 +336,12 @@ try
332336 }
333337
334338 Context " A scheduled task exists and is configured with the wrong execution account" {
335- # Ignoring this because we need to generate a stub credential to use in unit tests
336- [Diagnostics.CodeAnalysis.SuppressMessageAttribute (" PSAvoidUsingConvertToSecureStringWithPlainText" , " " )]
337- $credential = New-Object System.Management.Automation.PSCredential (" DEMO\RightUser" , (ConvertTo-SecureString " ExamplePassword" - AsPlainText - Force))
338339 $testParams = @ {
339340 TaskName = " Test task"
340341 ActionExecutable = " C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe"
341342 ScheduleType = " Minutes"
342343 RepeatInterval = 15
343- ExecuteAsCredential = $credential
344+ ExecuteAsCredential = New-Object System.Management.Automation.PSCredential ( " DEMO\RightUser " , ( ConvertTo-SecureString " ExamplePassword " - AsPlainText - Force))
344345 }
345346
346347 Mock Get-ScheduledTask { return @ {
You can’t perform that action at this time.
0 commit comments