title: Trying to download a file to a directory on a remote server
body: <p>I am getting this error</p>
  
  <blockquote>
    <p>Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient request."</p>
  </blockquote>
  
  <p>From this script</p>
  
  <pre><code>$username = "Administrator"
  $password = "PASSWORD"
  $secstr = New-Object -TypeName System.Security.SecureString
  $password.ToCharArray() | ForEach-Object {$secstr.AppendChar($_)}
  $cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $secstr
  $url = "http://www.website.com/file.zip"
  $path = "C:\file.zip"
  $client = new-object System.Net.WebClient
  $client.DownloadFile( $url, $path )
  Invoke-Command -ComputerName 69.69.69.69 -ScriptBlock { $client } -credential $cred
  </code></pre>
  
  <p>Running on Windows Web Server 2008</p>
  
  <p>Script purpose is to download file.zip to a remote server (there are hundreds of servers so I can't be prompted for the password each time) and see the progress bar of the download.</p>
  
  <p>Any ideas?</p>