diff --git a/ZertoApiWrapper/Public/Invoke-ZertoRestRequest.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoRestRequest.ps1 index a899434..00e1160 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoRestRequest.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoRestRequest.ps1 @@ -61,11 +61,15 @@ function Invoke-ZertoRestRequest { Uri = $submittedURI Method = $method Headers = $headers - Body = $body TimeoutSec = 100 ContentType = "application/json" } + # Ensure GET requests do not include a body + if ($method -ne "GET") { + $params["Body"] = $body + } + # Handle authentication requests if ($uri -match "auth/realms/.*/protocol/openid-connect/token" -and $method -eq "POST") { $data = @{