Skip to content

Commit 93b0b2c

Browse files
authored
Merge pull request KelvinTegelaar#1677 from Zacgoose/patch-gdap
Refactor Reference assignment in GDAP invite script
2 parents 53199a2 + 012c36d commit 93b0b2c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/GDAP/Invoke-ExecGDAPInvite.ps1

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,9 @@ function Invoke-ExecGDAPInvite {
9494
'OnboardingUrl' = $OnboardingUrl
9595
'RoleMappings' = [string](@($RoleMappings) | ConvertTo-Json -Depth 10 -Compress)
9696
'Technician' = [string]$Technician
97+
'Reference' = if ($Reference) { [string]$Reference } else { $null }
9798
}
9899

99-
if ($Reference) { $InviteEntity['Reference'] = [string]$Reference }
100-
101100
Add-CIPPAzDataTableEntity @Table -Entity $InviteEntity
102101

103102
$Message = 'GDAP relationship invite created. Log in as a Global Admin in the new tenant to approve the invite.'
@@ -133,10 +132,9 @@ function Invoke-ExecGDAPInvite {
133132
'PartitionKey' = 'invite'
134133
'RowKey' = $InviteId
135134
'Technician' = $Technician
135+
'Reference' = if ($Reference) { $Reference } else { $null }
136136
}
137137

138-
if ($Reference) { $InviteEntity['Reference'] = $Reference }
139-
140138
Add-CIPPAzDataTableEntity @Table -Entity $InviteEntity -OperationType 'UpsertMerge'
141139
$Message = 'Invite updated'
142140
} else {

0 commit comments

Comments
 (0)