File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Core Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ function Invoke-ListExtensionCacheData {
2+ <#
3+ . SYNOPSIS
4+ List Extension Cache Data
5+ . DESCRIPTION
6+ This function is used to list the extension cache data.
7+ . FUNCTIONALITY
8+ Entrypoint
9+ . ROLE
10+ CIPP.Core.Read
11+ #>
12+ [CmdletBinding ()]
13+ param ($Request , $TriggerMetadata )
14+
15+ $APIName = $Request.Params.CIPPEndpoint
16+ $Headers = $Request.Headers
17+ Write-LogMessage - headers $Headers - API $APIName - message ' Accessed this API' - Sev ' Debug'
18+
19+ $TenantFilter = $Request.Query.tenantFilter ?? $Request.Body.tenantFilter
20+ $DataTypes = $Request.Query.dataTypes -split ' ,' ?? $Request.Body.dataTypes ?? ' All'
21+
22+ $Data = Get-ExtensionCacheData - TenantFilter $TenantFilter
23+
24+ if ($DataTypes -ne ' All' ) {
25+ $Data = $Data | Select-Object $DataTypes
26+ }
27+
28+ if (! $Data ) {
29+ $Results = @ {}
30+ }
31+
32+ $Body = @ {
33+ Results = $Data
34+ }
35+
36+ $StatusCode = [HttpStatusCode ]::OK
37+
38+ Push-OutputBinding - Name Response - Value ([HttpResponseContext ]@ {
39+ StatusCode = $StatusCode
40+ Body = $Body | ConvertTo-Json - Compress - Depth 100
41+ Headers = @ {
42+ ' Content-Type' = ' application/json'
43+ }
44+ })
45+ }
You can’t perform that action at this time.
0 commit comments