Private/Security/ConditionalAccess/Get-ConditionalAccessPolicyData.ps1
function Get-ConditionalAccessPolicyData { [CmdletBinding()] param ( ) if ([datetime]::UtcNow -ge $TimeToRefresh) { Connect-PoshGraphRefresh } $RestSplat = @{ Uri = "https://graph.microsoft.com/beta/identity/conditionalAccess/policies" Headers = @{ "Authorization" = "Bearer $Token" } Method = 'Get' } Invoke-RestMethod @RestSplat -Verbose:$false | Select-Object -ExpandProperty value } |