Skip to content

Commit 482c185

Browse files
authored
Merge branch 'KelvinTegelaar:dev' into dev
2 parents 5197e8a + abf80f4 commit 482c185

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Modules/CIPPCore/Public/Entrypoints/Invoke-ListIntunePolicy.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Function Invoke-ListIntunePolicy {
2424
if ($ID) {
2525
$GraphRequest = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/deviceManagement/$($urlname)('$ID')" -tenantid $tenantfilter
2626
} else {
27-
$Groups = New-GraphGetRequest -uri 'https://graph.microsoft.com/beta/groups' -tenantid $tenantfilter | Select-Object -Property id, displayName
27+
$Groups = New-GraphGetRequest -uri 'https://graph.microsoft.com/beta/groups?$top=999' -tenantid $tenantfilter | Select-Object -Property id, displayName
2828

2929
$BulkRequests = [PSCustomObject]@(
3030
@{
@@ -56,7 +56,9 @@ Function Invoke-ListIntunePolicy {
5656

5757
$BulkResults = New-GraphBulkRequest -Requests $BulkRequests -tenantid $TenantFilter
5858

59-
$GraphRequest = $BulkResults.body.value | ForEach-Object {
59+
$GraphRequest = $BulkResults | ForEach-Object {
60+
$URLName = $_.Id
61+
$_.body.Value | ForEach-Object {
6062
$policyTypeName = switch -Wildcard ($_.'assignments@odata.context') {
6163
'*microsoft.graph.windowsIdentityProtectionConfiguration*' { 'Identity Protection' }
6264
'*microsoft.graph.windows10EndpointProtectionConfiguration*' { 'Endpoint Protection' }
@@ -95,7 +97,7 @@ Function Invoke-ListIntunePolicy {
9597
$_ | Add-Member -NotePropertyName PolicyExclude -NotePropertyValue ($PolicyExclude -join ', ')
9698
$_
9799
} | Where-Object { $_.DisplayName -ne $null }
98-
100+
}
99101
}
100102
$StatusCode = [HttpStatusCode]::OK
101103
} catch {

0 commit comments

Comments
 (0)