File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343 }
4444
4545 It " should return a compliant state after being applied" {
46- (Test-DscConfiguration - ReferenceConfiguration $ConfigMof ).InDesiredState | Should be $true
46+ (Test-DscConfiguration - ReferenceConfiguration $ConfigMof - Verbose ).InDesiredState | Should be $true
4747 }
4848 }
4949
6565 }
6666
6767 It " should return a compliant state after being applied" {
68- (Test-DscConfiguration - ReferenceConfiguration $ConfigMof ).InDesiredState | Should be $true
68+ (Test-DscConfiguration - ReferenceConfiguration $ConfigMof - Verbose ).InDesiredState | Should be $true
6969 }
7070 }
7171
8787 }
8888
8989 It " should return a compliant state after being applied" {
90- (Test-DscConfiguration - ReferenceConfiguration $ConfigMof ).InDesiredState | Should be $true
90+ (Test-DscConfiguration - ReferenceConfiguration $ConfigMof - Verbose ).InDesiredState | Should be $true
9191 }
9292 }
9393
109109 }
110110
111111 It " should return a compliant state after being applied" {
112- (Test-DscConfiguration - ReferenceConfiguration $ConfigMof ).InDesiredState | Should be $true
112+ (Test-DscConfiguration - ReferenceConfiguration $ConfigMof - Verbose ).InDesiredState | Should be $true
113113 }
114114 }
115115
131131 }
132132
133133 It " should return a compliant state after being applied" {
134- (Test-DscConfiguration - ReferenceConfiguration $ConfigMof ).InDesiredState | Should be $true
134+ (Test-DscConfiguration - ReferenceConfiguration $ConfigMof - Verbose ).InDesiredState | Should be $true
135135 }
136136 }
137137
153153 }
154154
155155 It " should return a compliant state after being applied" {
156- (Test-DscConfiguration - ReferenceConfiguration $ConfigMof ).InDesiredState | Should be $true
156+ (Test-DscConfiguration - ReferenceConfiguration $ConfigMof - Verbose ).InDesiredState | Should be $true
157157 }
158158 }
159159
Original file line number Diff line number Diff line change 1- # Ignoring this because we need to generate a stub credential to use in unit tests
2- [Diagnostics.CodeAnalysis.SuppressMessageAttribute (" PSAvoidUsingConvertToSecureStringWithPlainText" , " " )]
3-
41$Global :DSCModuleName = ' xComputerManagement'
52$Global :DSCResourceName = ' MSFT_xScheduledTask'
63
@@ -335,12 +332,15 @@ try
335332 }
336333
337334 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))
338338 $testParams = @ {
339339 TaskName = " Test task"
340340 ActionExecutable = " C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe"
341341 ScheduleType = " Minutes"
342342 RepeatInterval = 15
343- ExecuteAsCredential = New-Object System.Management.Automation.PSCredential ( " DEMO\RightUser " , ( ConvertTo-SecureString " ExamplePassword " - AsPlainText - Force))
343+ ExecuteAsCredential = $credential
344344 }
345345
346346 Mock Get-ScheduledTask { return @ {
You can’t perform that action at this time.
0 commit comments