title: How to set file name to default when downloaded with PowerShell
body: <p>Just started using powershell on windows 7 and I want to download a file from a site that doesn't include the name of the file in the url. Right now I am using </p>
  
  <pre><code>$webclient = New-Object System.Net.WebClient
  $src = "http://just-some-short-url/"
  $dest = "C:\Users\Downloads\some-file-2.53.jar"
  $webclient.DownloadFile($src,$dst)
  </code></pre>
  
  <p>And this works but only because I specify the name with some hard-coded value. But I really just want to say</p>
  
  <pre><code>$webclient = New-Object System.Net.WebClient
  $src = "http://just-some-short-url/"
  $dest = "C:\Users\Downloads\"
  $webclient.DownloadFile($src,$dst)
  </code></pre>
  
  <p>So that whatever version is downloaded would just be named such in the <code>C:\Users\Downloads\</code> so for example next month when there is a new update to the file I get from the same link presumably I would then have a file named <code>some-file-2.54.jar</code> However the latter code throws an error and is only fixed by hard coding the file name.</p>