title: Download a file form dynamic URL
body: <p>I'm facing a problem when trying to download a file with a PowerShell script:</p>
  
  <p>The issue is that the file's name changes dynamically, so I'm not sure about how to define the URL path.</p>
  
  <p>For example, I'd like to download a file from "http://definitions.symantec.com/defs/jdb/<em>FILE_NAME</em>", but the file's name (e.g., "2wer123.jdb") changes every day.</p>
  
  <p>Following, you can see the script I'm currently working on. However, I don't know how to implement a solution for tackling the dynamic name. </p>
  
  <pre><code>$source = "http://definitions.symantec.com/defs/jdb/*.jdb";
  $dest = "F:\Program Files (x86)\xXXXXXx\xXXXXXx\xXXXx\xXXx\content\incoming\virus_def.jdb";
  $secPasswd = ConvertTo-SecureString "adfasfdasfl" -AsPlainText -Force
  $myCreds = New-Object System.Management.Automation.PSCredential -ArgumentList "sadfas.sdafasf.sfdasdfaf.sfs.sdfs\Administrator", $secPasswd
  $Test = Invoke-WebRequest -Uri $source -OutFile $dest -Proxy 'http:\\sdfs.sdfs.sadfsa:8080' -ProxyCredential $mycreds
  </code></pre>