Skip to content

Commit 992c730

Browse files
G.ReijnG.Reijn
G.Reijn
authored and
G.Reijn
committed
Convert JSON
1 parent b403a5f commit 992c730

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

powershell-adapter/Tests/win_powershellgroup.tests.ps1

+4-6
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,15 @@ resources:
164164
- "[resourceId('Microsoft.Windows/WindowsPowerShell', 'File')]"
165165
- "[resourceId('Microsoft.DSC/Assertion', 'File present')]"
166166
"@
167-
# outputting to file because dsc doesn't handle the yaml string correctly when dependsOn is used
167+
# output to file for Windows PowerShell 5.1
168168
$filePath = "$testdrive\test.assertion.dsc.resource.yaml"
169169
$yaml | Set-Content -Path $filePath -Force
170170
dsc config test -f $filePath 2> "$TestDrive/error.txt"
171171
$LASTEXITCODE | Should -Be 1
172172

173-
$cache = Get-Content -Raw -Path $cacheFilePath
174-
$cache.ResourceCache | Should -Contain @('PSTestModule/TestPSRepository', 'PSDesiredStateConfiguration/File')
175-
176-
# Clean up the test module directory
177-
Remove-Item -Path "$testModuleDir" -Recurse -Force -ErrorAction Ignore
173+
$cache = Get-Content -Path $cacheFilePath -Raw | ConvertFrom-Json
174+
$cache.ResourceCache.Type | Should -Contain 'PSTestModule/TestPSRepository'
175+
$cache.ResourceCache.Type | Should -Contain 'PSDesiredStateConfiguration/File'
178176
}
179177

180178
It '_inDesiredState is returned correction: <Context>' -Skip:(!$IsWindows) -TestCases @(

0 commit comments

Comments
 (0)