File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Core Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ function Invoke-ExecServicePrincipals {
22
22
' appId' = $Request.Query.AppId
23
23
} | ConvertTo-Json - Compress
24
24
try {
25
- $Results = New-GraphPostRequest - Uri ' https://graph.microsoft.com/beta/servicePrincipals' - tenantid $TenantFilter - type POST - body $Body - NoAuthCheck $true
25
+ $ServicePrincipal = New-GraphPostRequest - Uri ' https://graph.microsoft.com/beta/servicePrincipals' - tenantid $TenantFilter - type POST - body $Body - NoAuthCheck $true
26
+ $Results = " Created service principal for $ ( $ServicePrincipal.displayName ) ($ ( $ServicePrincipal.appId ) )"
26
27
} catch {
27
28
$Results = " Unable to create service principal: $ ( $_.Exception.Message ) "
28
29
$Success = $false
@@ -55,6 +56,10 @@ function Invoke-ExecServicePrincipals {
55
56
' Success' = $Success
56
57
}
57
58
59
+ if ($ServicePrincipal ) {
60
+ $Metadata.ServicePrincipal = $ServicePrincipal
61
+ }
62
+
58
63
if ($Request.Query.AppId ) {
59
64
$Metadata.AppId = $Request.Query.AppId
60
65
}
You can’t perform that action at this time.
0 commit comments