title: PowerShell script to download a zip file and unzip it
body: <p>I need some help in putting my thoughts together in a working code.</p>
  
  <p>This is what I have:</p>
  
  <p>1st Step: I am getting the FTP user name and password as params.</p>
  
  <pre><code>param(#define parameters
  [Parameter(Position=0,Mandatory=$true)]
      [string]$FTPUser
  [Parameter(Position=1,Mandatory=$true)]
      [string]$FTPPassword    
  [Parameter(Position=2,Mandatory=$true)]
      [string]$Version    
  )
  </code></pre>
  
  <p>I then set these variables:</p>
  
  <pre><code>$FTPServer = "ftp.servername.com"
  $SetType = "bin"
  </code></pre>
  
  <p>Now, I want to establish a connection. I Google'd for Syntax and found this. Not sure if this will establish a FTP connection. I am yet to test,</p>
  
  <pre><code>$webclient = New-Object System.Net.WebClient 
      $webclient.Credentials = New-Object System.Net.NetworkCredential($FTPUser,$FTPPassword) 
  </code></pre>
  
  <p>This is the part I do not know how to code:</p>
  
  <p><code>$Version</code> is one of my input parameter. I have a zip file in FTP as:</p>
  
  <pre><code>ftp.servername.com\builds\my builds\$Version\Client\Client.zip
  </code></pre>
  
  <p>I want to download that Client.zip into my local machine's (where the script is run from) <code>"C:\myApp\$Version"</code> folder. 
  So, the FTP download will create a new sub-folder with the <code>$version</code> name with in <code>C:\myApp</code> for every run.</p>
  
  <p>Once this is done, I also need to know how to unzip this client.zip file under <code>C:\myApp\$Version\Client\&lt;content of the zip file will be here&gt;</code></p>