Login | |
|
 |
RE: System.Net.WebClient - 11/14/2006 12:40:36 AM
|
|
 |
|
| |
SAPIENScripter
Posts: 276
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
|
The command works fine if you use a host name instead of the IP address. $page=(new-object system.net.webclient).DownloadString("http://www.jdhitsolutions.com:80") I'm assuming the WebClient object is expecting a name and not an IP address.
_____________________________
Jeffery Hicks Windows PowerShell MVP SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com Follow Me: http://www.twitter.com/JeffHicks
|
|
| |
|
|
|
 |
RE: System.Net.WebClient - 11/14/2006 4:10:14 AM
|
|
 |
|
| |
SAPIENScripter
Posts: 276
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
|
That is very odd. The only time I get your problem is if I use an IP address. Do you get the same result regardless of what hostname you use? If you used $page=(new-object system.net.webclient).DownloadString("http://www.jdhitsolutions.com:80") do you get the same error? I'm curious if this is a PowerShell/.NET issue or something specific to the server you are trying to connect to. Are you running PowerShell RC2?
_____________________________
Jeffery Hicks Windows PowerShell MVP SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com Follow Me: http://www.twitter.com/JeffHicks
|
|
| |
|
|
|
 |
RE: System.Net.WebClient - 11/14/2006 7:53:57 AM
|
|
 |
|
| |
SAPIENScripter
Posts: 276
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
|
It makes sense that if you have a firewall or proxy this will cause a problem. I don't know without some research how this class gets around or uses a proxy.
_____________________________
Jeffery Hicks Windows PowerShell MVP SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com Follow Me: http://www.twitter.com/JeffHicks
|
|
| |
|
|
|
|
|