Skip to content

Commit 162c0ba

Browse files
committed
Update powershell to use the latest SDK and API, minor changes to responses and help files
1 parent dc14ca5 commit 162c0ba

28 files changed

+6028
-819
lines changed

src/ResourceManager/Resources/Commands.Resources.Test/Commands.Resources.Test.csproj

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
<Reference Include="Microsoft.Azure.Insights">
6868
<HintPath>..\..\..\packages\Microsoft.Azure.Insights.0.10.0-preview\lib\net45\Microsoft.Azure.Insights.dll</HintPath>
6969
</Reference>
70-
<Reference Include="Microsoft.Azure.Management.ManagementGroups, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
71-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.ManagementGroups.1.0.0-preview\lib\net452\Microsoft.Azure.Management.ManagementGroups.dll</HintPath>
70+
<Reference Include="Microsoft.Azure.Management.ManagementGroups, Version=1.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
71+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.ManagementGroups.1.2.0-preview\lib\net452\Microsoft.Azure.Management.ManagementGroups.dll</HintPath>
7272
</Reference>
7373
<Reference Include="Microsoft.Azure.Management.ResourceManager, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7474
<SpecificVersion>False</SpecificVersion>
@@ -93,14 +93,8 @@
9393
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
9494
<Private>True</Private>
9595
</Reference>
96-
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
97-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.10\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
98-
<Private>True</Private>
99-
</Reference>
100-
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
101-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.10\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
102-
<Private>True</Private>
103-
</Reference>
96+
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
97+
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
10498
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.Authentication, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
10599
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.Authentication.2.2.9-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.Authentication.dll</HintPath>
106100
<Private>True</Private>

src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ManagementGroupsTests.ps1

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

4749
function 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

8489
function 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

129139
function Test-NewManagementGroup

0 commit comments

Comments
 (0)