Get-Url has been useless to me at work since it doesn't use my default proxy set up in IE.

Topics: Developer Forum
Jul 4, 2007 at 3:51 AM
I've added a couple of statements to the end of the script to load the default proxy. I'm not sure if anybody else has experienced this.

Thanks again for a wonderful tool,
Scott Hoggarth

  1. ---------------------------------------------------------------------------
      1. <Script>
      2. <Author>Keith Hill</Author>
      3. <Description>
      4. This script scrapes the web page of the supplied web URL and
      5. outputs a string containing the contents of the web page.
      6. </Description>
      7. <Usage>Get-Url</Usage>
      8. </Script>
  2. ---------------------------------------------------------------------------

function Usage {
"Usage: Get-Url -Url <string>"
" -Url : Url of web page to download"
" -? : Display this usage information"

if ($args -eq '-?') {

if (!$Url) {
Write-Error "Please specify a url to download."

$webClient = new-object System.Net.WebClient
$webProxy = System.Net.WebProxy::GetDefaultProxy()
$webProxy.UseDefaultCredentials = "True"
$webClient.Proxy = $webProxy
Jul 5, 2007 at 3:53 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.