Skip to content

Commit c0dc301

Browse files
G.ReijnGijsreyn
G.Reijn
authored andcommitted
Fix assertion
1 parent 8dd36cc commit c0dc301

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

powershell-adapter/Tests/win_powershellgroup.tests.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ Describe 'WindowsPowerShell adapter resource tests - requires elevated permissio
8888
# }
8989

9090
It 'Verify if assertion is used that no module is cleared in the cache' -Skip:(!$IsWindows) {
91-
BeforeAll {
92-
New-Item -Path "$testdrive\test.txt" -ItemType File -Force | Out-Null
93-
}
91+
# create a test file in the test drive
92+
$testFile = "$testdrive\test.txt"
93+
New-Item -Path $testFile -ItemType File -Force | Out-Null
9494

9595
# remove cache file
9696
$cacheFilePath = Join-Path $env:LocalAppData "dsc\WindowsPSAdapterCache.json"
@@ -140,7 +140,7 @@ resources:
140140
- name: File
141141
type: PSDesiredStateConfiguration/File
142142
properties:
143-
DestinationPath: $testdrive\test.txt
143+
DestinationPath: $testfile
144144
- name: File present
145145
type: Microsoft.DSC/Assertion
146146
properties:
@@ -153,7 +153,7 @@ resources:
153153
- name: File present
154154
type: PSDesiredStateConfiguration/File
155155
properties:
156-
DestinationPath: $testDrive\test.txt
156+
DestinationPath: $testFile
157157
dependsOn:
158158
- "[resourceId('Microsoft.Windows/WindowsPowerShell', 'File')]"
159159
- name: TestPSRepository

0 commit comments

Comments
 (0)