Skip to content

Commit 7986be7

Browse files
committed
Refactor alert message to not be bad
1 parent 39dde3c commit 7986be7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Modules/CIPPCore/Public/Alerts/Get-CIPPAlertNewAppApproval.ps1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@ function Get-CIPPAlertNewAppApproval {
2828
"https://login.microsoftonline.com/$($TenantFilter)/adminConsent?client_id=$($App.appId)&bf_id=$($App.id)&redirect_uri=https://entra.microsoft.com/TokenAuthorize"
2929
}
3030

31-
$Message = "App name: $($App.appDisplayName) - Request user: $($_.createdBy.user.userPrincipalName) - Reason: $($_.reason)`nApp Id: $($App.appId) - Scopes: $($App.pendingScopes.displayName)`nConsent URL: $consentUrl"
31+
$Message = [PSCustomObject]@{
32+
AppName = $App.appDisplayName
33+
RequestUser = $_.createdBy.user.userPrincipalName
34+
Reason = $_.reason
35+
AppId = $App.appId
36+
Scopes = ($App.pendingScopes.displayName -join ', ')
37+
ConsentURL = $consentUrl
38+
Tenant = $TenantFilter
39+
}
3240
$AlertData.Add($Message)
3341
}
3442
}

0 commit comments

Comments
 (0)