Public/Intune/GraphIdentities/Get-GraphUnifiedRole.ps1
function Get-GraphUnifiedRole { [CmdletBinding()] param ( ) if ([datetime]::UtcNow -ge $TimeToRefresh) { Connect-PoshGraphRefresh } $RestSplat = @{ Uri = 'https://graph.microsoft.com/beta/roleManagement/directory/roleDefinitions' Headers = @{ "Authorization" = "Bearer $Token" } Method = 'Get' } Invoke-RestMethod @RestSplat -Verbose:$false | Select-Object -expandproperty Value } |