@@ -33,6 +33,7 @@ function Test-GetManagementGroup
33
33
$expectedDisplayName = " TestPSGetGroup2"
34
34
$expectedParentId = " /providers/Microsoft.Management/managementGroups/TestPSGetGroup1"
35
35
$expectedParentDisplayName = " TestPSGetGroup1"
36
+ $expectedParentName = " TestPSGetGroup1"
36
37
37
38
Assert-NotNull $response
38
39
Assert-Null $response.Children
@@ -42,6 +43,7 @@ function Test-GetManagementGroup
42
43
Assert-AreEqual $response.DisplayName $expectedDisplayName
43
44
Assert-AreEqual $response.ParentId $expectedParentId
44
45
Assert-AreEqual $response.ParentDisplayName $expectedParentDisplayName
46
+ Assert-AreEqual $response.ParentName $expectedParentName
45
47
}
46
48
47
49
function Test-GetManagementGroupWithExpand
@@ -62,10 +64,11 @@ function Test-GetManagementGroupWithExpand
62
64
$expectedDisplayName = " TestPSGetGroup2"
63
65
$expectedParentId = " /providers/Microsoft.Management/managementGroups/TestPSGetGroup1"
64
66
$expectedParentDisplayName = " TestPSGetGroup1"
67
+ $expectedParentName = " TestPSGetGroup1"
65
68
66
69
$expectedChild0Id = " /providers/Microsoft.Management/managementGroups/TestPSGetGroup3"
67
70
$expectedChild0DisplayName = " TestPSGetGroup3"
68
-
71
+ $expectedChild0Name = " TestPSGetGroup3 "
69
72
70
73
Assert-NotNull $response
71
74
Assert-NotNull $response.Children
@@ -76,9 +79,11 @@ function Test-GetManagementGroupWithExpand
76
79
Assert-AreEqual $response.DisplayName $expectedDisplayName
77
80
Assert-AreEqual $response.ParentId $expectedParentId
78
81
Assert-AreEqual $response.ParentDisplayName $expectedParentDisplayName
82
+ Assert-AreEqual $response.ParentName $expectedParentName
79
83
80
- Assert-AreEqual $response.Children [0 ].ChildId $expectedChild0Id
81
- Assert-AreEqual $response.Children [0 ].DisplayName $expectedChild0DisplayName
84
+ Assert-AreEqual $response.Children [0 ].Id $expectedChild0Id
85
+ Assert-AreEqual $response.Children [0 ].DisplayName $expectedChild0DisplayName
86
+ Assert-AreEqual $response.Children [0 ].Name $expectedChild0Name
82
87
}
83
88
84
89
function Test-GetManagementGroupWithExpandAndRecurse
@@ -101,13 +106,15 @@ function Test-GetManagementGroupWithExpandAndRecurse
101
106
$expectedDisplayName = " TestPSGetGroup2"
102
107
$expectedParentId = " /providers/Microsoft.Management/managementGroups/TestPSGetGroup1"
103
108
$expectedParentDisplayName = " TestPSGetGroup1"
109
+ $expectedParentName = " TestPSGetGroup1"
104
110
105
111
$expectedChild0Id = " /providers/Microsoft.Management/managementGroups/TestPSGetGroup3"
106
112
$expectedChild0DisplayName = " TestPSGetGroup3"
113
+ $expectedChild0Name = " TestPSGetGroup3"
107
114
108
115
$expectedChild0Child0Id = " /providers/Microsoft.Management/managementGroups/TestPSGetGroup4"
109
116
$expectedChild0Child0DisplayName = " TestPSGetGroup4"
110
-
117
+ $expectedChild0Child0Name = " TestPSGetGroup4 "
111
118
112
119
Assert-NotNull $response
113
120
Assert-NotNull $response.Children
@@ -118,12 +125,15 @@ function Test-GetManagementGroupWithExpandAndRecurse
118
125
Assert-AreEqual $response.DisplayName $expectedDisplayName
119
126
Assert-AreEqual $response.ParentId $expectedParentId
120
127
Assert-AreEqual $response.ParentDisplayName $expectedParentDisplayName
128
+ Assert-AreEqual $response.ParentName $expectedParentName
121
129
122
- Assert-AreEqual $response.Children [0 ].ChildId $expectedChild0Id
123
- Assert-AreEqual $response.Children [0 ].DisplayName $expectedChild0DisplayName
130
+ Assert-AreEqual $response.Children [0 ].Id $expectedChild0Id
131
+ Assert-AreEqual $response.Children [0 ].DisplayName $expectedChild0DisplayName
132
+ Assert-AreEqual $response.Children [0 ].Name $expectedChild0Name
124
133
125
- Assert-AreEqual $response.Children [0 ].Children[0 ].ChildId $expectedChild0Child0Id
134
+ Assert-AreEqual $response.Children [0 ].Children[0 ].Id $expectedChild0Child0Id
126
135
Assert-AreEqual $response.Children [0 ].Children[0 ].DisplayName $expectedChild0Child0DisplayName
136
+ Assert-AreEqual $response.Children [0 ].Children[0 ].Name $expectedChild0Child0Name
127
137
}
128
138
129
139
function Test-NewManagementGroup
0 commit comments