@@ -177,23 +177,15 @@ function Test-ArrayVariable
177
177
- value $variableValue `
178
178
- Encrypted:$false `
179
179
- Description " array"
180
- Assert-AreEqual ($variableValue | ConvertTo-Json ) $variableCreated.value.toString ()
181
-
182
- $getVariable = Get-AzAutomationVariable - ResourceGroupName $resourceGroupName `
183
- - AutomationAccountName $automationAccountName `
184
- - name $variableName
180
+ Assert-AreEqual ($variableValue | ConvertTo-Json - Compress - Depth 2 ) ($variableCreated.value | ConvertTo-Json - Compress - Depth 2 )
185
181
186
- Set-AzAutomationVariable - ResourceGroupName $resourceGroupName `
182
+ $updateVariable = Set-AzAutomationVariable - ResourceGroupName $resourceGroupName `
187
183
- AutomationAccountName $automationAccountName `
188
184
- Name $variableName `
189
185
- Encrypted:$false `
190
186
- value $variableValueUpdated
191
-
192
- $getVariable = Get-AzAutomationVariable - ResourceGroupName $resourceGroupName `
193
- - AutomationAccountName $automationAccountName `
194
- - name $variableName
195
187
196
- Assert-AreEqual ($variableValueUpdated | ConvertTo-Json ) $getVariable .value.toString ( )
188
+ Assert-AreEqual ($variableValueUpdated | ConvertTo-Json - Compress - Depth 2 ) ( $updateVariable .value | ConvertTo-Json - Compress - Depth 2 )
197
189
198
190
Remove-AzAutomationVariable - ResourceGroupName $resourceGroupName `
199
191
- AutomationAccountName $automationAccountName `
@@ -225,23 +217,15 @@ function Test-NormalHashTableVariable
225
217
- value $variableValue `
226
218
- Encrypted:$false `
227
219
- Description " NormalHashTableVariable"
228
- Assert-AreEqual ($variableValue | ConvertTo-Json ) $variableCreated.value.toString ()
229
-
230
- $getVariable = Get-AzAutomationVariable - ResourceGroupName $resourceGroupName `
231
- - AutomationAccountName $automationAccountName `
232
- - name $variableName
220
+ Assert-AreEqual ($variableValue | ConvertTo-Json - Compress - Depth 2 ) ($variableCreated.value | ConvertTo-Json - Compress - Depth 2 )
233
221
234
- Set-AzAutomationVariable - ResourceGroupName $resourceGroupName `
222
+ $updateVariable = Set-AzAutomationVariable - ResourceGroupName $resourceGroupName `
235
223
- AutomationAccountName $automationAccountName `
236
224
- Name $variableName `
237
225
- Encrypted:$false `
238
226
- value $variableValueUpdated
239
-
240
- $getVariable = Get-AzAutomationVariable - ResourceGroupName $resourceGroupName `
241
- - AutomationAccountName $automationAccountName `
242
- - name $variableName
243
227
244
- Assert-AreEqual ($variableValueUpdated | ConvertTo-Json ) $getVariable .value.toString ( )
228
+ Assert-AreEqual ($variableValueUpdated | ConvertTo-Json - Compress - Depth 2 ) ( $updateVariable .value | ConvertTo-Json - Compress - Depth 2 )
245
229
246
230
Remove-AzAutomationVariable - ResourceGroupName $resourceGroupName `
247
231
- AutomationAccountName $automationAccountName `
@@ -273,23 +257,15 @@ function Test-MultiLevelDictVariable
273
257
- value $variableValue `
274
258
- Encrypted:$false `
275
259
- Description " MultiLevelDict"
276
- Assert-AreEqual ($variableValue | ConvertTo-Json ) $variableCreated.value.toString ()
277
-
278
- $getVariable = Get-AzAutomationVariable - ResourceGroupName $resourceGroupName `
279
- - AutomationAccountName $automationAccountName `
280
- - name $variableName
260
+ Assert-AreEqual ($variableValue | ConvertTo-Json - Compress - Depth 2 ) ($variableCreated.value | ConvertTo-Json - Compress - Depth 2 )
281
261
282
- Set-AzAutomationVariable - ResourceGroupName $resourceGroupName `
262
+ $updateVariable = Set-AzAutomationVariable - ResourceGroupName $resourceGroupName `
283
263
- AutomationAccountName $automationAccountName `
284
264
- Name $variableName `
285
265
- Encrypted:$false `
286
266
- value $variableValueUpdated
287
-
288
- $getVariable = Get-AzAutomationVariable - ResourceGroupName $resourceGroupName `
289
- - AutomationAccountName $automationAccountName `
290
- - name $variableName
291
267
292
- Assert-AreEqual ($variableValueUpdated | ConvertTo-Json ) $getVariable .value.toString ( )
268
+ Assert-AreEqual ($variableValueUpdated | ConvertTo-Json - Compress - Depth 2 ) ( $updateVariable .value | ConvertTo-Json - Compress - Depth 2 )
293
269
294
270
Remove-AzAutomationVariable - ResourceGroupName $resourceGroupName `
295
271
- AutomationAccountName $automationAccountName `
@@ -321,23 +297,15 @@ function Test-JsonInDictValueVariable
321
297
- value $variableValue `
322
298
- Encrypted:$false `
323
299
- Description " JsonInDictValue"
324
- Assert-AreEqual ($variableValue | ConvertTo-Json ) $variableCreated.value.toString ()
325
-
326
- $getVariable = Get-AzAutomationVariable - ResourceGroupName $resourceGroupName `
327
- - AutomationAccountName $automationAccountName `
328
- - name $variableName
300
+ Assert-AreEqual ($variableValue | ConvertTo-Json - Compress - Depth 2 ) ($variableCreated.value | ConvertTo-Json - Compress - Depth 2 )
329
301
330
- Set-AzAutomationVariable - ResourceGroupName $resourceGroupName `
302
+ $updateVariable = Set-AzAutomationVariable - ResourceGroupName $resourceGroupName `
331
303
- AutomationAccountName $automationAccountName `
332
304
- Name $variableName `
333
305
- Encrypted:$false `
334
306
- value $variableValueUpdated
335
-
336
- $getVariable = Get-AzAutomationVariable - ResourceGroupName $resourceGroupName `
337
- - AutomationAccountName $automationAccountName `
338
- - name $variableName
339
307
340
- Assert-AreEqual ($variableValueUpdated | ConvertTo-Json ) $getVariable .value.toString ( )
308
+ Assert-AreEqual ($variableValueUpdated | ConvertTo-Json - Compress - Depth 2 ) ( $updateVariable .value | ConvertTo-Json - Compress - Depth 2 )
341
309
342
310
Remove-AzAutomationVariable - ResourceGroupName $resourceGroupName `
343
311
- AutomationAccountName $automationAccountName `
0 commit comments