Skip to content

Commit

Permalink
fix list intune policy urlname
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Oct 11, 2024
1 parent 05f8d89 commit c91f25c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Function Invoke-ListIntunePolicy {
if ($ID) {
$GraphRequest = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/deviceManagement/$($urlname)('$ID')" -tenantid $tenantfilter
} else {
$Groups = New-GraphGetRequest -uri 'https://graph.microsoft.com/beta/groups' -tenantid $tenantfilter | Select-Object -Property id, displayName
$Groups = New-GraphGetRequest -uri 'https://graph.microsoft.com/beta/groups?$top=999' -tenantid $tenantfilter | Select-Object -Property id, displayName

$BulkRequests = [PSCustomObject]@(
@{
Expand Down Expand Up @@ -57,6 +57,8 @@ Function Invoke-ListIntunePolicy {
$BulkResults = New-GraphBulkRequest -Requests $BulkRequests -tenantid $TenantFilter

$GraphRequest = $BulkResults.body.value | ForEach-Object {
$URLName = (($_).split('?') | Select-Object -First 1) -replace 'https://graph.microsoft.com/beta/deviceManagement/', ''

$policyTypeName = switch -Wildcard ($_.'[email protected]') {
'*microsoft.graph.windowsIdentityProtectionConfiguration*' { 'Identity Protection' }
'*microsoft.graph.windows10EndpointProtectionConfiguration*' { 'Endpoint Protection' }
Expand Down

0 comments on commit c91f25c

Please sign in to comment.