mardi 22 novembre 2016

PowerShell ISE WebRequest calls limitation

The following code works by itself if running from a console, but when running it using PowerShell ISE, it fails with Exception calling "GetResponse" with "0" argument(s): "The operation has timed out" after two runs. Have to restart the ISE to run it again.

$req = [System.Net.WebRequest]::CreateHttp("http://ift.tt/gbk8l4")
$req.Timeout = 500
$req.GetResponse()

What is this limitation and is there a way to remove the limitation?

Aucun commentaire:

Enregistrer un commentaire