Skip to content

Commit 5d32509

Browse files
committed
fix object depth
1 parent 65138bd commit 5d32509

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ function Invoke-ExecAppInsightsQuery {
2424
try {
2525
$LogData = Get-ApplicationInsightsQuery -Query $Query
2626

27+
$Body = @{
28+
Results = @($LogData)
29+
Metadata = @{
30+
Query = $Query
31+
}
32+
} | ConvertTo-Json -Depth 10 -Compress
33+
2734
return [HttpResponseContext]@{
2835
StatusCode = [HttpStatusCode]::OK
29-
Body = @{
30-
Results = @($LogData)
31-
Metadata = @{
32-
Query = $Query
33-
}
34-
}
36+
Body = $Body
3537
}
3638

3739
} catch {

0 commit comments

Comments
 (0)