Skip to content

Commit 0e5ea21

Browse files
authored
Merge pull request #955 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents 8e15298 + 24fcd6b commit 0e5ea21

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Modules/CIPPCore/Public/Invoke-CIPPRestMethod.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ function Invoke-CIPPRestMethod {
8989
)
9090

9191
# ------------------------------------------------------------------
92-
# Escape hatch — env var kill switch or per-call legacy switch
92+
# Escape hatch — env var kill switch, missing pooled client type,
93+
# or per-call legacy switch
9394
# ------------------------------------------------------------------
94-
if ($UseLegacyInvokeRestMethod -or $env:DisableCIPPRestMethod -eq 'true') {
95+
$HasCippRestClient = $null -ne ('CIPP.CIPPRestClient' -as [type])
96+
if ($UseLegacyInvokeRestMethod -or $env:DisableCIPPRestMethod -eq 'true' -or -not $HasCippRestClient) {
9597
$LegacyParams = @{
9698
Uri = $Uri
9799
Method = $Method

0 commit comments

Comments
 (0)