Skip to content

Commit 5033884

Browse files
fixes token replacement
1 parent 3ef06a1 commit 5033884

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Modules/CIPPCore/Public/GraphHelper/New-GraphPOSTRequest.ps1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function New-GraphPOSTRequest {
2727
$Headers = $Headers
2828
} else {
2929
$Headers = Get-GraphToken -tenantid $tenantid -scope $scope -AsApp $asapp -SkipCache $skipTokenCache
30+
$body = Get-CIPPTextReplacement -TenantFilter $tenantid -Text $body -EscapeForJson
3031
}
3132
if ($AddedHeaders) {
3233
foreach ($header in $AddedHeaders.GetEnumerator()) {
@@ -41,8 +42,6 @@ function New-GraphPOSTRequest {
4142
if (!$contentType) {
4243
$contentType = 'application/json; charset=utf-8'
4344
}
44-
#Only do text replacement if no headers are set.
45-
if (!$headers) { $body = Get-CIPPTextReplacement -TenantFilter $tenantid -Text $body -EscapeForJson }
4645

4746
$RetryCount = 0
4847
$RequestSuccessful = $false

0 commit comments

Comments
 (0)