PowerShell Invoke-RestMethod : The operation has timed out


This is a known issue for PUT and DELETE methods in PowerShell REST API calls.

If you encounter this error use the following commands to close the Connection Group, this will close all the connections made to the host.


$ServicePoint = [System.Net.ServicePointManager]::FindServicePoint('<REST API URL>')
#Make the REST API Call using Invoke-RestMethod
$ServicePoint.CloseConnectionGroup("")

Leave a comment

Your email address will not be published. Required fields are marked *