Hello All,
I have this very simple Powershell 5.0 script that am struggling to make it work. Gone through numerous posts in this forum but none of them could help me in resolving the issue.
I am trying to make use of the "Invoke-WebRequest" cmdlet to make a GET call to one of our firm's internal URL but when executed I keep receiving the below error .
Supply values for the following parameters:
Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send.
At D:\Work\PowerShell Scripts\InvokeWebequest test.ps1:12 char:6
+ $r = Invoke-WebRequest -Uri $uri -Method GET -Credential $mycredentia ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestComm
The lines of my script are as pasted below .
$uri = "http://wiki.domain.com"
$mycredentials = Get-Credential # At the time of script execution, the correct username and password are entered
$r = Invoke-WebRequest -Uri $uri -Method GET -Credential $mycredentials -SessionVariable websession
Note: The Url in question is Siteminder protected and when accessed directly through browser doesn't prompt for login.