Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

100% Code Coverage for Add-AADAppRoleAssignment #5

Open
markekraus opened this issue Apr 22, 2017 · 0 comments
Open

100% Code Coverage for Add-AADAppRoleAssignment #5

markekraus opened this issue Apr 22, 2017 · 0 comments

Comments

@markekraus
Copy link
Owner

markekraus commented Apr 22, 2017

Code coverage report:
Covered 0 % of 33 analyzed Commands in Add-AADAppRoleAssignment
Missed commands:

Line Command
78 $ServicePrincipal
79 $User
80 $ProcessText = "User: '{0}' ServicePrincipal: '{1}' RoleID: '{2}'" -f $UserObject.ObjectId, $ServiceObject.ObjectId, $RoleID
81 if (-not $pscmdlet.ShouldProcess($ProcessText)) { ...
84 $AccessToken = $ServiceObject._AccessToken
85 $Application = $AccessToken.Application
86 $Tenant = $Application.Tenant
87 $Body = @{ ...
88 id = $RoleID
89 resourceId = $ServiceObject.ObjectId
90 principalId = $UserObject.ObjectId
91 $Body = @{ ...
92 $Url = '{0}/{1}/{2}/{3}/{4}?api-version={5}' -f @( ...
93 $BaseUrl
94 $Tenant
95 'users'
96 $UserObject.ObjectId
97 'appRoleAssignments'
98 $APIversion
100 $Params = @{ ...
101 Uri = $Url
102 Body = $Body
103 Method = 'POST'
104 AccessToken = $AccessToken
105 ErrorAction = 'Stop'
108 $Result = Invoke-GraphRequest @Params
111 ``` $ErrorMessage = "Unable to add App Assignments for User '{0}' to ServicePrincipal '{1}': {2}" -f $UserObject.ObjectId, $ServiceObject.Objec
tId, $_.Exception.Message ```
112 Write-Error $ErrorMessage
115 $OutputObject = $Result.ContentObject.psobject.copy()
116 $OutputObject.psobject.TypeNames.Insert(0, 'MSGraphAPI.DirectoryObject.AppRoleAssignment')
117 $OutputObject
117 Add-Member -MemberType NoteProperty -Name _AccessToken -Value $AccessToken
118 $OutputObject
@markekraus markekraus added this to the 100% Code Coverage milestone Apr 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant