Page 1 of 1

Remote Invoke-WebRequest gets error

Posted: Mon Jul 23, 2018 11:37 am
by cgjackson@yahoo.com
The script works on the remote box and with browser from the box I am remoting from.

The code is:
(Invoke-WebRequest https://xxxxxxxxx/$DateFrom).Content

Error is:
ERROR: The remote server returned an error: (404) Not Found.
ERROR: + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
ERROR: + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
ERROR: + PSComputerName : XXX
ERROR:

Re: Remote Invoke-WebRequest gets error

Posted: Mon Jul 23, 2018 12:30 pm
by jvierra
THe error says that the page was not found. Try it without using the variable.