@@ -33,6 +33,7 @@ function Test-GetManagementGroup
3333 $expectedDisplayName = " TestPSGetGroup2"
3434 $expectedParentId = " /providers/Microsoft.Management/managementGroups/TestPSGetGroup1"
3535 $expectedParentDisplayName = " TestPSGetGroup1"
36+ $expectedParentName = " TestPSGetGroup1"
3637
3738 Assert-NotNull $response
3839 Assert-Null $response.Children
@@ -42,6 +43,7 @@ function Test-GetManagementGroup
4243 Assert-AreEqual $response.DisplayName $expectedDisplayName
4344 Assert-AreEqual $response.ParentId $expectedParentId
4445 Assert-AreEqual $response.ParentDisplayName $expectedParentDisplayName
46+ Assert-AreEqual $response.ParentName $expectedParentName
4547}
4648
4749function Test-GetManagementGroupWithExpand
@@ -62,10 +64,11 @@ function Test-GetManagementGroupWithExpand
6264 $expectedDisplayName = " TestPSGetGroup2"
6365 $expectedParentId = " /providers/Microsoft.Management/managementGroups/TestPSGetGroup1"
6466 $expectedParentDisplayName = " TestPSGetGroup1"
67+ $expectedParentName = " TestPSGetGroup1"
6568
6669 $expectedChild0Id = " /providers/Microsoft.Management/managementGroups/TestPSGetGroup3"
6770 $expectedChild0DisplayName = " TestPSGetGroup3"
68-
71+ $expectedChild0Name = " TestPSGetGroup3 "
6972
7073 Assert-NotNull $response
7174 Assert-NotNull $response.Children
@@ -76,9 +79,11 @@ function Test-GetManagementGroupWithExpand
7679 Assert-AreEqual $response.DisplayName $expectedDisplayName
7780 Assert-AreEqual $response.ParentId $expectedParentId
7881 Assert-AreEqual $response.ParentDisplayName $expectedParentDisplayName
82+ Assert-AreEqual $response.ParentName $expectedParentName
7983
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
8287}
8388
8489function Test-GetManagementGroupWithExpandAndRecurse
@@ -101,13 +106,15 @@ function Test-GetManagementGroupWithExpandAndRecurse
101106 $expectedDisplayName = " TestPSGetGroup2"
102107 $expectedParentId = " /providers/Microsoft.Management/managementGroups/TestPSGetGroup1"
103108 $expectedParentDisplayName = " TestPSGetGroup1"
109+ $expectedParentName = " TestPSGetGroup1"
104110
105111 $expectedChild0Id = " /providers/Microsoft.Management/managementGroups/TestPSGetGroup3"
106112 $expectedChild0DisplayName = " TestPSGetGroup3"
113+ $expectedChild0Name = " TestPSGetGroup3"
107114
108115 $expectedChild0Child0Id = " /providers/Microsoft.Management/managementGroups/TestPSGetGroup4"
109116 $expectedChild0Child0DisplayName = " TestPSGetGroup4"
110-
117+ $expectedChild0Child0Name = " TestPSGetGroup4 "
111118
112119 Assert-NotNull $response
113120 Assert-NotNull $response.Children
@@ -118,12 +125,15 @@ function Test-GetManagementGroupWithExpandAndRecurse
118125 Assert-AreEqual $response.DisplayName $expectedDisplayName
119126 Assert-AreEqual $response.ParentId $expectedParentId
120127 Assert-AreEqual $response.ParentDisplayName $expectedParentDisplayName
128+ Assert-AreEqual $response.ParentName $expectedParentName
121129
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
124133
125- Assert-AreEqual $response.Children [0 ].Children[0 ].ChildId $expectedChild0Child0Id
134+ Assert-AreEqual $response.Children [0 ].Children[0 ].Id $expectedChild0Child0Id
126135 Assert-AreEqual $response.Children [0 ].Children[0 ].DisplayName $expectedChild0Child0DisplayName
136+ Assert-AreEqual $response.Children [0 ].Children[0 ].Name $expectedChild0Child0Name
127137}
128138
129139function Test-NewManagementGroup
0 commit comments