Skip to content

Commit

Permalink
universal search fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KelvinTegelaar committed Jan 3, 2025
1 parent 2406287 commit 56408ef
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ Function Invoke-ExecUniversalSearch {
)
}
} | ConvertTo-Json -Depth 10
$GraphRequest = (New-GraphPOSTRequest -noauthcheck $true -type 'POST' -uri 'https://graph.microsoft.com/beta/tenantRelationships/managedTenants/managedTenantOperations' -tenantid $env:TenantID -body $payload -IgnoreErrors $true)
$GraphRequest = New-GraphPOSTRequest -noauthcheck $true -type 'POST' -uri 'https://graph.microsoft.com/beta/tenantRelationships/managedTenants/managedTenantOperations' -tenantid $env:TenantID -body $payload -IgnoreErrors $true
if (!$GraphRequest.result.results) {
$GraphRequest = ($GraphRequest.error.message | ConvertFrom-Json).result.results | ConvertFrom-Json | Where-Object { $_.'_TenantId' -in $tenantfilter.customerId }
} else {
$GraphRequest.result.Results | ConvertFrom-Json -ErrorAction SilentlyContinue | Where-Object { $_.'_TenantId' -in $tenantfilter.customerId }
$GraphRequest = $GraphRequest.result.Results | ConvertFrom-Json -ErrorAction SilentlyContinue | Where-Object { $_.'_TenantId' -in $tenantfilter.customerId }
}
$StatusCode = [HttpStatusCode]::OK
} catch {
Expand Down

0 comments on commit 56408ef

Please sign in to comment.