@@ -34,7 +34,7 @@ Describe 'PowerShell adapter resource tests' {
3434 }
3535
3636 It ' Get does not work on config when module does not exist' {
37-
37+
3838 $yaml = @'
3939 $schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
4040 resources:
@@ -195,7 +195,7 @@ Describe 'PowerShell adapter resource tests' {
195195 type: TestClassResource/TestClassResource
196196 properties:
197197 Name: 'TestClassResource1'
198- HashTableProp:
198+ HashTableProp:
199199 Name: 'DSCv3'
200200"@
201201
@@ -218,7 +218,7 @@ Describe 'PowerShell adapter resource tests' {
218218 type: TestClassResource/TestClassResource
219219 properties:
220220 Name: 'TestClassResource1'
221- HashTableProp:
221+ HashTableProp:
222222 Name: 'DSCv3'
223223"@
224224
@@ -269,7 +269,7 @@ Describe 'PowerShell adapter resource tests' {
269269 Credential:
270270 UserName: 'User'
271271 OtherProperty: 'Password'
272- "@
272+ "@
273273 $out = dsc config get - i $yaml 2>&1 | Out-String
274274 $LASTEXITCODE | Should - Be 2
275275 $out | Should -Not - BeNullOrEmpty
@@ -310,5 +310,23 @@ Describe 'PowerShell adapter resource tests' {
310310 $out.resources [0 ].properties.result[0 ].Name | Should - Be " Object1"
311311 $out.resources [0 ].properties.result[0 ].Prop1 | Should - Be " Property of object1"
312312 }
313+
314+ It ' Expressions get passed correctly to adapted resource' {
315+ $yaml = @"
316+ `$ schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
317+ resources:
318+ - name: Class-resource Info
319+ type: TestClassResource/TestClassResource
320+ properties:
321+ Name: EchoBack
322+ Prop1: "[[this is a string literal]"
323+ EnumProp: 'Expected'
324+ "@
325+ $out = dsc config get - i $yaml | ConvertFrom-Json
326+ $LASTEXITCODE | Should - Be 0
327+ $out.results.result.actualState.Name | Should - BeExactly ' EchoBack'
328+ $out.results.result.actualState.Prop1 | Should - BeExactly ' [this is a string literal]'
329+ $out.results.result.actualState.EnumProp | Should - BeExactly ' Expected'
330+ }
313331}
314332
0 commit comments