@@ -17,7 +17,7 @@ Describe 'Parameters tests' {
1717 - name: Echo
1818 type: Test/Echo
1919 properties:
20- text : '[parameters(''param1'')]'
20+ output : '[parameters(''param1'')]'
2121"@
2222 $params_json = @ { parameters = @ { param1 = ' hello' }} | ConvertTo-Json
2323
@@ -31,16 +31,16 @@ Describe 'Parameters tests' {
3131 }
3232
3333 $LASTEXITCODE | Should - Be 0
34- $out.results [0 ].result.actualState.text | Should - BeExactly ' hello'
34+ $out.results [0 ].result.actualState.output | Should - BeExactly ' hello'
3535 }
3636
3737 It ' Input is <type>' - TestCases @ (
38- @ { type = ' string' ; value = ' hello' ; expected = ' hello ' }
39- @ { type = ' int' ; value = 42 ; expected = 42 }
40- @ { type = ' bool' ; value = $true ; expected = $true }
41- @ { type = ' array' ; value = @ (' hello' , ' world' ); expected = ' ["hello","world"] ' }
38+ @ { type = ' string' ; value = ' hello' }
39+ @ { type = ' int' ; value = 42 }
40+ @ { type = ' bool' ; value = $true }
41+ @ { type = ' array' ; value = @ (' hello' , ' world' )}
4242 ) {
43- param ($type , $value , $expected )
43+ param ($type , $value )
4444
4545 $config_yaml = @"
4646 `$ schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
@@ -51,13 +51,13 @@ Describe 'Parameters tests' {
5151 - name: Echo
5252 type: Test/Echo
5353 properties:
54- text : '[parameters(''param1'')]'
54+ output : '[parameters(''param1'')]'
5555"@
5656 $params_json = @ { parameters = @ { param1 = $value }} | ConvertTo-Json
5757
5858 $out = $config_yaml | dsc config - p $params_json get | ConvertFrom-Json
5959 $LASTEXITCODE | Should - Be 0
60- $out.results [0 ].result.actualState.text | Should - BeExactly $expected
60+ $out.results [0 ].result.actualState.output | Should - BeExactly $value
6161 }
6262
6363 It ' Input is incorrect type <type>' - TestCases @ (
@@ -77,7 +77,7 @@ Describe 'Parameters tests' {
7777 - name: Echo
7878 type: Test/Echo
7979 properties:
80- text : '[parameters(''param1'')]'
80+ output : '[parameters(''param1'')]'
8181"@
8282 $params_json = @ { parameters = @ { param1 = $value }} | ConvertTo-Json
8383
@@ -104,7 +104,7 @@ Describe 'Parameters tests' {
104104 - name: Echo
105105 type: Test/Echo
106106 properties:
107- text : '[parameters(''param1'')]'
107+ output : '[parameters(''param1'')]'
108108"@
109109 $params_json = @ { parameters = @ { param1 = $value }} | ConvertTo-Json
110110
@@ -130,7 +130,7 @@ Describe 'Parameters tests' {
130130 - name: Echo
131131 type: Test/Echo
132132 properties:
133- text : '[parameters(''param1'')]'
133+ output : '[parameters(''param1'')]'
134134"@
135135 $params_json = @ { parameters = @ { param1 = $value }} | ConvertTo-Json
136136
@@ -154,7 +154,7 @@ Describe 'Parameters tests' {
154154 - name: Echo
155155 type: Test/Echo
156156 properties:
157- text : '[parameters(''param1'')]'
157+ output : '[parameters(''param1'')]'
158158"@
159159 $params_json = @ { parameters = @ { param1 = $value }} | ConvertTo-Json
160160
@@ -180,7 +180,7 @@ Describe 'Parameters tests' {
180180 - name: Echo
181181 type: Test/Echo
182182 properties:
183- text : '[parameters(''param1'')]'
183+ output : '[parameters(''param1'')]'
184184"@
185185 $params_json = @ { parameters = @ { param1 = $value }} | ConvertTo-Json
186186
@@ -192,28 +192,43 @@ Describe 'Parameters tests' {
192192 $config_yaml = @"
193193 `$ schema: https://raw.githubusercontent.com/PowerShell/DSC/main/schemas/2023/10/config/document.json
194194 parameters:
195- param1 :
195+ paramString :
196196 type: string
197197 defaultValue: 'hello'
198- param2 :
198+ paramInt :
199199 type: int
200200 defaultValue: 7
201- param3 :
201+ paramBool :
202202 type: bool
203203 defaultValue: false
204- param4 :
204+ paramArray :
205205 type: array
206206 defaultValue: ['hello', 'world']
207207 resources:
208- - name: Echo
208+ - name: String
209+ type: Test/Echo
210+ properties:
211+ output: '[parameters(''paramString'')]'
212+ - name: Int
213+ type: Test/Echo
214+ properties:
215+ output: '[parameters(''paramInt'')]'
216+ - name: Bool
217+ type: Test/Echo
218+ properties:
219+ output: '[parameters(''paramBool'')]'
220+ - name: Array
209221 type: Test/Echo
210222 properties:
211- text : '[concat( parameters(''param1''),'','',parameters(''param2''),'','',parameters(''param3''),'','',parameters(''param4'') )]'
223+ output : '[parameters(''paramArray'' )]'
212224"@
213225
214226 $out = $config_yaml | dsc config get | ConvertFrom-Json
215227 $LASTEXITCODE | Should - Be 0
216- $out.results [0 ].result.actualState.text | Should - BeExactly ' hello,7,false,["hello","world"]'
228+ $out.results [0 ].result.actualState.output | Should - BeExactly ' hello'
229+ $out.results [1 ].result.actualState.output | Should - BeExactly 7
230+ $out.results [2 ].result.actualState.output | Should - BeExactly $false
231+ $out.results [3 ].result.actualState.output | Should - BeExactly @ (' hello' , ' world' )
217232 }
218233
219234 It ' property value uses parameter value' {
0 commit comments