File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Entrypoints/HTTP Functions/CIPP/Core Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,11 @@ function Invoke-ListGraphRequest {
124124
125125 try {
126126 $Results = Get-GraphRequestList @GraphRequestParams
127+
128+ if ($script :LastGraphResponseHeaders ) {
129+ $Metadata.GraphHeaders = $script :LastGraphResponseHeaders
130+ }
131+
127132 if ($Results | Where-Object { $_.PSObject.Properties.Name -contains ' nextLink' }) {
128133 if (! [string ]::IsNullOrEmpty($Results.nextLink ) -and $Request.Query.TenantFilter -ne ' AllTenants' ) {
129134 Write-Host " NextLink: $ ( $Results.nextLink | Where-Object { $_ } | Select-Object - Last 1 ) "
Original file line number Diff line number Diff line change @@ -73,15 +73,14 @@ function New-GraphGetRequest {
7373 Headers = $headers
7474 ContentType = ' application/json; charset=utf-8'
7575 }
76- if ($IncludeResponseHeaders ) {
77- $GraphRequest.ResponseHeadersVariable = ' ResponseHeaders'
78- }
7976
8077 if ($ReturnRawResponse ) {
8178 $GraphRequest.SkipHttpErrorCheck = $true
8279 $Data = Invoke-WebRequest @GraphRequest
8380 } else {
81+ $GraphRequest.ResponseHeadersVariable = ' ResponseHeaders'
8482 $Data = (Invoke-RestMethod @GraphRequest )
83+ $script :LastGraphResponseHeaders = $ResponseHeaders
8584 }
8685
8786 # If we reach here, the request was successful
You can’t perform that action at this time.
0 commit comments