Created
September 16, 2016 18:32
-
-
Save ctigeek/b069efafbebc0731fffcf830b4653947 to your computer and use it in GitHub Desktop.
Clean up after Invoke-RestMethod after PUT or DELETE.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$baseUrl = "https://blah.com" | |
$servicePoint = [System.Net.ServicePointManager]::FindServicePoint($baseUrl) | |
$url = "$baseUrl/blah/blah/blah" | |
Invoke-RestMethod -Uri $url -Method Delete -ErrorAction Stop | |
##without this cleanup, the above line will stop working after two calls | |
$ServicePoint.CloseConnectionGroup("") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment