Skip to content

Commit 2ce910b

Browse files
committed
fix application copy
enterprise apps with only application level permissions would fail to detect ticket 22188960558
1 parent 6998c73 commit 2ce910b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/CIPPCore/Public/New-CIPPApplicationCopy.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ function New-CIPPApplicationCopy {
2222
$ExistingAppRoleAssignments = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/servicePrincipals(appId='$($app)')/appRoleAssignments" -tenantid $env:TenantID -NoAuthCheck $true -AsApp $true
2323
$Type = 'ServicePrincipal'
2424
}
25-
if (!$ExistingApp) {
26-
Write-LogMessage -message "Failed to add $App to tenant. This app does not exist." -tenant $tenant -API 'Application Copy' -sev error
25+
if (!$ExistingApp -and !$ExistingAppRoleAssignments) {
26+
Write-LogMessage -message "Failed to add $App to tenant. This app does not exist or does not have any consented permissions." -tenant $tenant -API 'Application Copy' -sev error
2727
continue
2828
}
2929
if ($Type -eq 'Application') {

0 commit comments

Comments
 (0)