Examples/06-Export-PolicyInventory.ps1

<#
    Exports policy inventories from both SIA policy engines. Only one will
    return meaningful results depending on which your tenant uses - see
    docs/API-COMPATIBILITY.md.
#>


try {
    Get-SIAPolicy | Export-Csv -Path './access-control-policies.csv' -NoTypeInformation
    Write-Host 'Unified access control policies exported to ./access-control-policies.csv'
} catch {
    Write-Warning "Unified Access Control Policies API not available on this tenant: $_"
}

try {
    Get-SIAAccessPolicy | Export-Csv -Path './legacy-access-policies.csv' -NoTypeInformation
    Write-Host 'Legacy access policies exported to ./legacy-access-policies.csv'
} catch {
    Write-Warning "Legacy SIA Access Policies API not available on this tenant: $_"
}