You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$res.results[1].result.actualState.result[0].properties.Name | Should -Not-BeNullOrEmpty
56
57
$res.results[1].result.actualState.result[0].properties.BootupState | Should -BeNullOrEmpty
57
58
$res.results[1].result.actualState.result[1].properties.Caption | Should -Not-BeNullOrEmpty
58
59
$res.results[1].result.actualState.result[1].properties.BuildNumber | Should -BeNullOrEmpty
59
-
$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
61
+
}
62
+
63
+
It 'Set does not work without input for resource'-Skip:(!$IsWindows) {
64
+
$out= dsc resource set --resource root.cimv2/Win32_Environment --input '{}'2>$TestDrive/error.log
65
+
$out| Should -BeNullOrEmpty
66
+
(Get-Content$TestDrive/error.log -Raw) | Should -BeLike "*No valid properties found in the CIM class 'Win32_Environment' for the provided properties.*"
67
+
}
68
+
69
+
It 'Set does not work without a key property'-Skip:(!$IsWindows) {
70
+
$i=@{
71
+
VariableValue="TestValue"
72
+
UserName= ("{0}\{1}"-f$env:USERDOMAIN,$env:USERNAME) # Read-only property is key, but we require a key property to be set
73
+
} |ConvertTo-Json
74
+
75
+
$out= dsc resource set -r root.cimv2/Win32_Environment -i $i2>$TestDrive/error2.log
76
+
$out| Should -BeNullOrEmpty
77
+
(Get-Content$TestDrive/error2.log -Raw) | Should -BeLike "*All properties specified in the CIM class 'Win32_Environment' are read-only, which is not supported.*"
78
+
}
79
+
80
+
It 'Set works on a WMI resource'-Skip:(!$IsWindows) {
0 commit comments