@@ -53,17 +53,16 @@ Describe 'WMI adapter resource tests' {
5353 $r | Should -Not - BeNullOrEmpty
5454 $res = $r | ConvertFrom-Json
5555
56- Write-Verbose ($res.results [1 ].result.actualState.result[4 ] | ConvertTo-Json - Depth 10 ) - Verbose
5756 $res.results [1 ].result.actualState.result[0 ].properties.Name | Should -Not - BeNullOrEmpty
5857 $res.results [1 ].result.actualState.result[0 ].properties.BootupState | Should - BeNullOrEmpty
5958 $res.results [1 ].result.actualState.result[1 ].properties.Caption | Should -Not - BeNullOrEmpty
6059 $res.results [1 ].result.actualState.result[1 ].properties.BuildNumber | Should - BeNullOrEmpty
61- $res.results [1 ].result.actualState.result[4 ].properties.AdapterType | Should - BeLike " Ethernet* "
60+ $res.results [1 ].result.actualState.result[4 ].properties.Name | Should -Not - BeNullOrEmpty
6261 }
6362
6463 It ' Set does not work without input for resource' - Skip:(! $IsWindows ) {
65- $s = dsc resource set -- resource root.cimv2/ Win32_Environment -- input ' {}' 2>&1
66- $s | Should - BeLike " *No valid properties found in the CIM class 'Win32_Environment' for the provided properties.*"
64+ $out = dsc resource set -- resource root.cimv2/ Win32_Environment -- input ' {}' 2>&1
65+ $out [ 0 ] | Should - BeLike " *No valid properties found in the CIM class 'Win32_Environment' for the provided properties.*"
6766 }
6867
6968 It ' Set does not work without a key property' - Skip:(! $IsWindows ) {
@@ -72,8 +71,8 @@ Describe 'WMI adapter resource tests' {
7271 UserName = (" {0}\{1}" -f $env: USERDOMAIN , $env: USERNAME ) # Read-only property is key, but we require a key property to be set
7372 } | ConvertTo-Json
7473
75- $s = dsc resource set - r root.cimv2/ Win32_Environment - i $i 2>&1
76- $s | Should - BeLike " *All key properties in the CIM class 'Win32_Environment' are read-only, which is not supported.*"
74+ $out = dsc resource set - r root.cimv2/ Win32_Environment - i $i 2>&1
75+ $out [ 0 ] | Should - BeLike " *All key properties in the CIM class 'Win32_Environment' are read-only, which is not supported.*"
7776 }
7877
7978 It ' Set works on a WMI resource' - Skip:(! $IsWindows ) {
@@ -86,10 +85,10 @@ Describe 'WMI adapter resource tests' {
8685 $r = dsc resource set - r root.cimv2/ Win32_Environment - i $i
8786 $LASTEXITCODE | Should - Be 0
8887
89- $out = $r | ConvertFrom-Json
90- $out .afterState.Name | Should - Be ' test'
91- $out .afterState.VariableValue | Should - Be ' test'
92- $out .afterState.UserName | Should - Be (" {0}\{1}" -f $env: USERDOMAIN , $env: USERNAME )
88+ $res = $r | ConvertFrom-Json
89+ $res .afterState.Name | Should - Be ' test'
90+ $res .afterState.VariableValue | Should - Be ' test'
91+ $res .afterState.UserName | Should - Be (" {0}\{1}" -f $env: USERDOMAIN , $env: USERNAME )
9392 }
9493
9594 It ' Update works on a WMI resource' - Skip:(! $IsWindows ) {
@@ -102,9 +101,9 @@ Describe 'WMI adapter resource tests' {
102101 $r = dsc resource set - r root.cimv2/ Win32_Environment - i $i
103102 $LASTEXITCODE | Should - Be 0
104103
105- $out = $r | ConvertFrom-Json
106- $out .afterState.Name | Should - Be ' test'
107- $out .afterState.VariableValue | Should - Be ' update'
108- $out .afterState.UserName | Should - Be (" {0}\{1}" -f $env: USERDOMAIN , $env: USERNAME )
104+ $res = $r | ConvertFrom-Json
105+ $res .afterState.Name | Should - Be ' test'
106+ $res .afterState.VariableValue | Should - Be ' update'
107+ $res .afterState.UserName | Should - Be (" {0}\{1}" -f $env: USERDOMAIN , $env: USERNAME )
109108 }
110109}
0 commit comments