File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Modules/CIPPCore/Public/Alerts Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,22 @@ function Get-CIPPAlertAppSecretExpiry {
1818 return
1919 }
2020
21- $AlertData = foreach ($App in $applist ) {
21+ $AlertData = [System.Collections.Generic.List [PSCustomObject ]]::new()
22+
23+ foreach ($App in $applist ) {
2224 Write-Host " checking $ ( $App.displayName ) "
2325 if ($App.passwordCredentials ) {
2426 foreach ($Credential in $App.passwordCredentials ) {
2527 if ($Credential.endDateTime -lt (Get-Date ).AddDays(30 ) -and $Credential.endDateTime -gt (Get-Date ).AddDays(-7 )) {
2628 Write-Host (" Application '{0}' has secrets expiring on {1}" -f $App.displayName , $Credential.endDateTime )
27- @ { DisplayName = $App.displayName ; Expires = $Credential.endDateTime }
29+
30+ $Message = [PSCustomObject ]@ {
31+ AppName = $App.displayName
32+ AppId = $App.appId
33+ Expires = $Credential.endDateTime
34+ Tenant = $TenantFilter
35+ }
36+ $AlertData.Add ($Message )
2837 }
2938 }
3039 }
You can’t perform that action at this time.
0 commit comments