@@ -19,7 +19,6 @@ Tests retrieval of classic administrators
19
19
function Test-RaClassicAdmins
20
20
{
21
21
# Setup
22
- Add-Type - Path " .\\Microsoft.Azure.Commands.Resources.dll"
23
22
$subscription = Get-AzureRmSubscription
24
23
25
24
# Test
@@ -37,8 +36,6 @@ Tests verifies negative scenarios for RoleAssignments
37
36
function Test-RaNegativeScenarios
38
37
{
39
38
# Setup
40
- Add-Type - Path " .\\Microsoft.Azure.Commands.Resources.dll"
41
-
42
39
$subscription = Get-AzureRmSubscription
43
40
44
41
# Bad OID returns zero role assignments
@@ -66,8 +63,6 @@ Tests verifies creation and deletion of a RoleAssignments by Scope
66
63
function Test-RaByScope
67
64
{
68
65
# Setup
69
- Add-Type - Path " .\\Microsoft.Azure.Commands.Resources.dll"
70
-
71
66
$definitionName = ' Reader'
72
67
$users = Get-AzureRmADUser | Select-Object - First 1 - Wait
73
68
$subscription = Get-AzureRmSubscription
@@ -101,8 +96,6 @@ Tests verifies creation and deletion of a RoleAssignments by Resource Group
101
96
function Test-RaByResourceGroup
102
97
{
103
98
# Setup
104
- Add-Type - Path " .\\Microsoft.Azure.Commands.Resources.dll"
105
-
106
99
$definitionName = ' Contributor'
107
100
$users = Get-AzureRmADUser | Select-Object - Last 1 - Wait
108
101
$resourceGroups = Get-AzureRmResourceGroup | Select-Object - Last 1 - Wait
@@ -134,8 +127,6 @@ Tests verifies creation and deletion of a RoleAssignments by Resource
134
127
function Test-RaByResource
135
128
{
136
129
# Setup
137
- Add-Type - Path " .\\Microsoft.Azure.Commands.Resources.dll"
138
-
139
130
$definitionName = ' Owner'
140
131
$groups = Get-AzureRmADGroup | Select-Object - Last 1 - Wait
141
132
Assert-AreEqual 1 $groups.Count " There should be at least one group to run the test."
@@ -171,8 +162,6 @@ Tests validate input parameters
171
162
function Test-RaValidateInputParameters ($cmdName )
172
163
{
173
164
# Setup
174
- Add-Type - Path " .\\Microsoft.Azure.Commands.Resources.dll"
175
-
176
165
$definitionName = ' Owner'
177
166
$groups = Get-AzureRmADGroup | Select-Object - Last 1 - Wait
178
167
Assert-AreEqual 1 $groups.Count " There should be at least one group to run the test."
@@ -224,8 +213,6 @@ Tests verifies creation and deletion of a RoleAssignments for Service principal
224
213
function Test-RaByServicePrincipal
225
214
{
226
215
# Setup
227
- Add-Type - Path " .\\Microsoft.Azure.Commands.Resources.dll"
228
-
229
216
$definitionName = ' Reader'
230
217
$servicePrincipals = Get-AzureRmADServicePrincipal | Select-Object - Last 1 - Wait
231
218
$subscription = Get-AzureRmSubscription
@@ -260,8 +247,6 @@ Tests verifies creation and deletion of a RoleAssignments for User Principal Nam
260
247
function Test-RaByUpn
261
248
{
262
249
# Setup
263
- Add-Type - Path " .\\Microsoft.Azure.Commands.Resources.dll"
264
-
265
250
$definitionName = ' Contributor'
266
251
$users = Get-AzureRmADUser | Select-Object - Last 1 - Wait
267
252
$resourceGroups = Get-AzureRmResourceGroup | Select-Object - Last 1 - Wait
@@ -290,9 +275,6 @@ function Test-RaByUpn
290
275
function Test-RaUserPermissions
291
276
{
292
277
param ([string ]$rgName , [string ]$action )
293
-
294
- # Setup
295
-
296
278
# Test
297
279
$rg = Get-AzureRmResourceGroup
298
280
$errorMsg = " User should have access to only 1 RG. Found: {0}" -f $rg.Count
@@ -309,8 +291,6 @@ Tests verifies creation and deletion of a RoleAssignments by Scope irrespective
309
291
function Test-RaDeletionByScope
310
292
{
311
293
# Setup
312
- Add-Type - Path " .\\Microsoft.Azure.Commands.Resources.dll"
313
-
314
294
$definitionName = ' Reader'
315
295
$users = Get-AzureRmADUser | Select-Object - First 1 - Wait
316
296
$subscription = Get-AzureRmSubscription
@@ -346,8 +326,6 @@ function CreateRoleAssignment
346
326
{
347
327
param ([string ]$roleAssignmentId , [string ]$userId , [string ]$definitionName , [string ]$resourceGroupName )
348
328
349
- Add-Type - Path " .\\Microsoft.Azure.Commands.Resources.dll"
350
-
351
329
[Microsoft.Azure.Commands.Resources.Models.Authorization.AuthorizationClient ]::RoleAssignmentNames.Enqueue($roleAssignmentId )
352
330
$newAssignment = New-AzureRmRoleAssignment `
353
331
- ObjectId $userId `
0 commit comments