File tree Expand file tree Collapse file tree
Modules/CIPPCore/Public/Entrypoints Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using namespace System.Net
2+
3+ function Invoke-ListCheckExtAlerts {
4+ <#
5+ . FUNCTIONALITY
6+ Entrypoint
7+ . ROLE
8+ CIPP.Core.Read
9+ #>
10+ [CmdletBinding ()]
11+ param ($Request , $TriggerMetadata )
12+
13+ $APIName = $Request.Params.CIPPEndpoint
14+ $Headers = $Request.Headers
15+
16+ $TenantFilter = $Request.Query.tenantFilter
17+ $Table = Get-CIPPTable - tablename CheckExtensionAlerts
18+
19+ if ($TenantFilter -and $TenantFilter -ne ' AllTenants' ) {
20+ $Filter = " PartitionKey eq '$TenantFilter '"
21+ } else {
22+ $Filter = $null
23+ }
24+
25+ try {
26+ $Alerts = Get-CIPPAzDataTableEntity @Table - Filter $Filter
27+ } catch {
28+ Write-LogMessage - headers $Headers - API $APIName - message " Failed to retrieve check extension alerts: $ ( $_.Exception.Message ) " - Sev ' Error'
29+ $Alerts = @ ()
30+ }
31+
32+ # Associate values to output bindings by calling 'Push-OutputBinding'.
33+ Push-OutputBinding - Name Response - Value ([HttpResponseContext ]@ {
34+ StatusCode = [HttpStatusCode ]::OK
35+ Body = @ ($Alerts | Sort-Object - Property Timestamp - Descending)
36+ })
37+ }
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ function Invoke-PublicPhishingCheck {
2323 $TableBody = @ {
2424 RowKey = " $ID "
2525 PartitionKey = [string ]$Tenant.defaultDomainName
26+ tenantFilter = [string ]$Tenant.defaultDomainName
2627 message = [string ]$Message
2728 type = [string ]$request.body.type
2829 url = [string ]$request.body.url
You can’t perform that action at this time.
0 commit comments