@@ -37,6 +37,11 @@ Describe 'PowerShell adapter resource tests' {
37
37
$LASTEXITCODE | Should - Be 0
38
38
$res = $r | ConvertFrom-Json
39
39
$res.actualState.result.properties.Prop1 | Should - BeExactly ' ValueForProp1'
40
+
41
+ # verify that only properties with DscProperty attribute are returned
42
+ $propertiesNames = $res.actualState.result.properties | Get-Member - MemberType NoteProperty | % Name
43
+ $propertiesNames | Should -Not - Contain ' NonDscProperty'
44
+ $propertiesNames | Should -Not - Contain ' HiddenNonDscProperty'
40
45
}
41
46
42
47
It ' Get uses enum names on class-based resource' {
@@ -53,6 +58,11 @@ Describe 'PowerShell adapter resource tests' {
53
58
$LASTEXITCODE | Should - Be 0
54
59
$res = $r | ConvertFrom-Json
55
60
$res.actualState.result.properties.InDesiredState | Should - Be $True
61
+
62
+ # verify that only properties with DscProperty attribute are returned
63
+ $propertiesNames = $res.actualState.result.properties.InDesiredState | Get-Member - MemberType NoteProperty | % Name
64
+ $propertiesNames | Should -Not - Contain ' NonDscProperty'
65
+ $propertiesNames | Should -Not - Contain ' HiddenNonDscProperty'
56
66
}
57
67
58
68
It ' Set works on class-based resource' {
@@ -71,6 +81,13 @@ Describe 'PowerShell adapter resource tests' {
71
81
$res.resources [0 ].properties.result.count | Should - Be 5
72
82
$res.resources [0 ].properties.result[0 ].Name | Should - Be " Object1"
73
83
$res.resources [0 ].properties.result[0 ].Prop1 | Should - Be " Property of object1"
84
+
85
+ # verify that only properties with DscProperty attribute are returned
86
+ $res.resources [0 ].properties.result | % {
87
+ $propertiesNames = $_ | Get-Member - MemberType NoteProperty | % Name
88
+ $propertiesNames | Should -Not - Contain ' NonDscProperty'
89
+ $propertiesNames | Should -Not - Contain ' HiddenNonDscProperty'
90
+ }
74
91
}
75
92
76
93
It ' Get --all works on PS class-based resource' {
0 commit comments