File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,15 @@ function Set-CIPPSAMAdminRoles {
2020 $SAMRolesTable = Get-CIPPTable - tablename ' SAMRoles'
2121 $Roles = Get-CIPPAzDataTableEntity @SAMRolesTable
2222
23- $SAMRoles = $Roles.Roles | ConvertFrom-Json
24- $Tenants = $Roles.Tenants | ConvertFrom-Json
25- if ($Tenants.value ) {
26- $Tenants = $Tenants.value
23+ try {
24+ $SAMRoles = $Roles.Roles | ConvertFrom-Json - ErrorAction Stop
25+ $Tenants = $Roles.Tenants | ConvertFrom-Json - ErrorAction Stop
26+ if ($Tenants.value ) {
27+ $Tenants = $Tenants.value
28+ }
29+ } catch {
30+ $ActionLogs.Add (' CIPP-SAM roles not configured' )
31+ return $ActionLogs
2732 }
2833
2934 if (($SAMRoles | Measure-Object ).count -gt 0 -and $Tenants -contains $TenantFilter -or $Tenants -contains ' AllTenants' ) {
You can’t perform that action at this time.
0 commit comments