Skip to content

Commit 7ea10d8

Browse files
committed
add support for query param
1 parent f9be12f commit 7ea10d8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/CIPP/Core/Invoke-ExecAppInsightsQuery.ps1

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function Invoke-ExecAppInsightsQuery {
1111
$TriggerMetadata
1212
)
1313

14-
$Query = $Request.Body.query
14+
$Query = $Request.Body.query ?? $Request.Query.query
1515
if (-not $Query) {
1616
return [HttpResponseContext]@{
1717
StatusCode = [HttpStatusCode]::BadRequest
@@ -22,17 +22,17 @@ function Invoke-ExecAppInsightsQuery {
2222
}
2323

2424
try {
25-
$LogData = Get-ApplicationInsightsQuery -Query $Query
25+
$LogData = Get-ApplicationInsightsQuery -Query $Query
2626

27-
return [HttpResponseContext]@{
28-
StatusCode = [HttpStatusCode]::OK
29-
Body = @{
30-
Results = @($LogData)
31-
}
32-
Metadata = @{
33-
Query = $Query
27+
return [HttpResponseContext]@{
28+
StatusCode = [HttpStatusCode]::OK
29+
Body = @{
30+
Results = @($LogData)
31+
}
32+
Metadata = @{
33+
Query = $Query
34+
}
3435
}
35-
}
3636

3737
} catch {
3838
return [HttpResponseContext]@{

0 commit comments

Comments
 (0)