Skip to content

Commit aaac06e

Browse files
committed
Verbose logging in the right place this time
1 parent f53a3a7 commit aaac06e

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

Tests/Integration/MSFT_xScheduledTask.Integration.Tests.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ try
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

@@ -65,7 +65,7 @@ try
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

@@ -87,7 +87,7 @@ try
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

@@ -109,7 +109,7 @@ try
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

@@ -131,7 +131,7 @@ try
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

@@ -153,7 +153,7 @@ try
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

Tests/Unit/MSFT_xScheduledTask.Tests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
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 @{

0 commit comments

Comments
 (0)