File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -80,12 +80,12 @@ function Update-MsIdInvitedUserSponsorsFromInvitedBy {
8080
8181 $invitedBy = Invoke-MgGraphRequest @splatArgumentsGetInvitedBy
8282
83- Write-Verbose ($invitedBy | ConvertTo-Json )
83+ Write-Verbose ($invitedBy | ConvertTo-Json - Depth 10 )
8484
8585 if ($null -ne $invitedBy -and $null -ne $invitedBy.value -and $null -ne (Get-ObjectPropertyValue $invitedBy.value - Property ' id' )) {
8686 Write-Verbose (" InvitedBy for Guest User {0}: {1}" -f $InvitedUser.DisplayName , $invitedBy.value.id )
8787
88- if ($ InvitedUser.Sponsors. id -notcontains $invitedBy.value.id ) {
88+ if (( $null -like $ InvitedUser.Sponsors ) -or ( $InvitedUser .Sponsors. id -notcontains $invitedBy.value.id ) ) {
8989 Write-Verbose (" Sponsors does not contain the user who invited them!" )
9090
9191 if ($PSCmdlet.ShouldProcess ((" {0} - {1}" -f $InvitedUser.displayName , $InvitedUser.id ), " Update Sponsors" )) {
You can’t perform that action at this time.
0 commit comments