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
It 'Set does not work without input for resource'-Skip:(!$IsWindows) {
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.*"
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.*"
66
67
}
67
68
68
69
It 'Set does not work without a key property'-Skip:(!$IsWindows) {
UserName= ("{0}\{1}"-f$env:USERDOMAIN,$env:USERNAME) # Read-only property is key, but we require a key property to be set
72
73
} |ConvertTo-Json
73
74
74
-
$out= dsc resource set -r root.cimv2/Win32_Environment -i $i2>&1
75
-
$out[0] | Should -BeLike "*All key properties in the CIM class 'Win32_Environment' are read-only, which is not supported.*"
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 key properties in the CIM class 'Win32_Environment' are read-only, which is not supported.*"
76
78
}
77
79
78
80
It 'Set works on a WMI resource'-Skip:(!$IsWindows) {
0 commit comments