From 0546b72a4ba2b6f2a27f8c78f9f0cb0db7ab602a Mon Sep 17 00:00:00 2001 From: John Duprey Date: Thu, 3 Oct 2024 18:11:04 -0400 Subject: [PATCH] AsApp support --- .../Graph Requests/Push-ListGraphRequestQueue.ps1 | 1 + .../Public/GraphRequests/Get-GraphRequestList.ps1 | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Graph Requests/Push-ListGraphRequestQueue.ps1 b/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Graph Requests/Push-ListGraphRequestQueue.ps1 index b3f88c0b9e73..c7b2de89ec5a 100644 --- a/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Graph Requests/Push-ListGraphRequestQueue.ps1 +++ b/Modules/CIPPCore/Public/Entrypoints/Activity Triggers/Graph Requests/Push-ListGraphRequestQueue.ps1 @@ -34,6 +34,7 @@ function Push-ListGraphRequestQueue { NoPagination = $Item.NoPagination ReverseTenantLookupProperty = $Item.ReverseTenantLookupProperty ReverseTenantLookup = $Item.ReverseTenantLookup + AsApp = $Item.AsApp ?? $false SkipCache = $true } diff --git a/Modules/CIPPCore/Public/GraphRequests/Get-GraphRequestList.ps1 b/Modules/CIPPCore/Public/GraphRequests/Get-GraphRequestList.ps1 index 43d7617833c1..ba85c3884bbf 100644 --- a/Modules/CIPPCore/Public/GraphRequests/Get-GraphRequestList.ps1 +++ b/Modules/CIPPCore/Public/GraphRequests/Get-GraphRequestList.ps1 @@ -64,7 +64,8 @@ function Get-GraphRequestList { [switch]$CountOnly, [switch]$NoAuthCheck, [switch]$ReverseTenantLookup, - [string]$ReverseTenantLookupProperty = 'tenantId' + [string]$ReverseTenantLookupProperty = 'tenantId', + [boolean]$AsApp = $false ) $SingleTenantThreshold = 8000 @@ -110,6 +111,9 @@ function Get-GraphRequestList { if ($NoAuthCheck.IsPresent) { $GraphRequest.noauthcheck = $NoAuthCheck.IsPresent } + if ($AsApp) { + $GraphRequest.asApp = $AsApp + } if ($Parameters.'$count' -and !$SkipCache.IsPresent -and !$NoPagination.IsPresent) { $Count = New-GraphGetRequest @GraphRequest -CountOnly -ErrorAction Stop if ($CountOnly.IsPresent) { return $Count } @@ -174,6 +178,8 @@ function Get-GraphRequestList { NoPagination = $using:NoPagination.IsPresent ReverseTenantLookupProperty = $using:ReverseTenantLookupProperty ReverseTenantLookup = $using:ReverseTenantLookup.IsPresent + NoAuthCheck = $using:NoAuthCheck.IsPresent + AsApp = $using:AsApp SkipCache = $true } @@ -220,6 +226,7 @@ function Get-GraphRequestList { PartitionKey = $PartitionKey NoPagination = $NoPagination.IsPresent NoAuthCheck = $NoAuthCheck.IsPresent + AsApp = $AsApp ReverseTenantLookupProperty = $ReverseTenantLookupProperty ReverseTenantLookup = $ReverseTenantLookup.IsPresent }