Skip to content

Commit 3bc409d

Browse files
committed
Update Invoke-ExecCreateSAMApp.ps1
1 parent 3ec1ead commit 3bc409d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Setup/Invoke-ExecCreateSAMApp.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using namespace System.Net
22

3-
Function Invoke-ExecCreateSAMApp {
3+
function Invoke-ExecCreateSAMApp {
44
<#
55
.FUNCTIONALITY
66
Entrypoint,AnyTenant
@@ -19,7 +19,7 @@ Function Invoke-ExecCreateSAMApp {
1919
$URL = ($Request.headers.'x-ms-original-url').split('/api') | Select-Object -First 1
2020
$TenantId = (Invoke-RestMethod 'https://graph.microsoft.com/v1.0/organization' -Headers @{ authorization = "Bearer $($Token.access_token)" } -Method GET -ContentType 'application/json').value.id
2121
#Find Existing app registration
22-
$AppId = (Invoke-RestMethod 'https://graph.microsoft.com/v1.0/applications' -Headers @{ authorization = "Bearer $($Token.access_token)" } -Method GET -ContentType 'application/json' -Body "{ `"filter`": `"displayName eq 'CIPP-SAM'`" }").value | Select-Object -Last 1
22+
$AppId = (Invoke-RestMethod "https://graph.microsoft.com/v1.0/applications?`$filter=displayName eq 'CIPP-SAM'" -Headers @{ authorization = "Bearer $($Token.access_token)" } -Method GET -ContentType 'application/json').value | Select-Object -Last 1
2323
#Check if the appId has the redirect URI, if not, add it.
2424
if ($AppId) {
2525
Write-Host "Found existing app: $($AppId.id). Reusing."

0 commit comments

Comments
 (0)