Skip to content

Commit 12082a7

Browse files
authored
Merge pull request KelvinTegelaar#1222 from JohnDuprey/dev
hotfixes
2 parents 1d09cd4 + ff0fe24 commit 12082a7

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ Function Invoke-ExecAutoExtendGDAP {
1010
[CmdletBinding()]
1111
param($Request, $TriggerMetadata)
1212

13-
$APIName = $TriggerMetadata.FunctionName
14-
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug'
15-
16-
# Interact with query parameters or the body of the request.
17-
$Results = Set-CIPPGDAPAutoExtend -RelationShipid $Request.query.ID
13+
$Id = $Request.query.ID ?? $Request.Body.ID
14+
$Results = Set-CIPPGDAPAutoExtend -RelationShipid $Id
1815

1916
# Associate values to output bindings by calling 'Push-OutputBinding'.
2017
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ Function Invoke-ExecGDAPRemoveGArole {
99
[CmdletBinding()]
1010
param($Request, $TriggerMetadata)
1111

12-
$APIName = $TriggerMetadata.FunctionName
13-
Write-LogMessage -user $request.headers.'x-ms-client-principal' -API $APINAME -message 'Accessed this API' -Sev 'Debug'
14-
15-
$GDAPID = $request.query.GDAPId
12+
$GDAPID = $request.query.GDAPId ?? $request.Body.GDAPId
1613

1714
try {
1815
$CheckActive = New-GraphGetRequest -NoAuthCheck $True -uri "https://graph.microsoft.com/beta/tenantRelationships/delegatedAdminRelationships/$($GDAPID)" -tenantid $env:TenantID
@@ -36,7 +33,7 @@ Function Invoke-ExecGDAPRemoveGArole {
3633
$Message = "Relationship status is currently $($CheckActive.status), it is not possible to remove the Global Administrator role in this state."
3734
}
3835
if ('62e90394-69f5-4237-9190-012177145e10' -notin $CheckActive.accessDetails.unifiedRoles.roleDefinitionId) {
39-
$Message = "This relationship does not contain the Global Administrator role."
36+
$Message = 'This relationship does not contain the Global Administrator role.'
4037
}
4138
}
4239
} catch {

Modules/CIPPCore/Public/GraphHelper/New-GraphGetRequest.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function New-GraphGetRequest {
1010
[string]$scope,
1111
[bool]$AsApp,
1212
[bool]$noPagination,
13-
[bool]$NoAuthCheck,
13+
$NoAuthCheck = $false,
1414
[bool]$skipTokenCache,
1515
$Caller,
1616
[switch]$ComplexFilter,

0 commit comments

Comments
 (0)