@@ -34,7 +34,7 @@ Describe 'PowerShell adapter resource tests' {
34
34
}
35
35
36
36
It ' Get does not work on config when module does not exist' {
37
-
37
+
38
38
$yaml = @'
39
39
$schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2024/04/config/document.json
40
40
resources:
@@ -195,7 +195,7 @@ Describe 'PowerShell adapter resource tests' {
195
195
type: TestClassResource/TestClassResource
196
196
properties:
197
197
Name: 'TestClassResource1'
198
- HashTableProp:
198
+ HashTableProp:
199
199
Name: 'DSCv3'
200
200
"@
201
201
@@ -218,7 +218,7 @@ Describe 'PowerShell adapter resource tests' {
218
218
type: TestClassResource/TestClassResource
219
219
properties:
220
220
Name: 'TestClassResource1'
221
- HashTableProp:
221
+ HashTableProp:
222
222
Name: 'DSCv3'
223
223
"@
224
224
@@ -269,7 +269,7 @@ Describe 'PowerShell adapter resource tests' {
269
269
Credential:
270
270
UserName: 'User'
271
271
OtherProperty: 'Password'
272
- "@
272
+ "@
273
273
$out = dsc config get - i $yaml 2>&1 | Out-String
274
274
$LASTEXITCODE | Should - Be 2
275
275
$out | Should -Not - BeNullOrEmpty
@@ -310,5 +310,23 @@ Describe 'PowerShell adapter resource tests' {
310
310
$out.resources [0 ].properties.result[0 ].Name | Should - Be " Object1"
311
311
$out.resources [0 ].properties.result[0 ].Prop1 | Should - Be " Property of object1"
312
312
}
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
+ }
313
331
}
314
332
0 commit comments