Using Powershell for ftp
From MyWiki
Reference : http://stackoverflow.com/questions/936108/how-to-script-ftp-upload-and-download
//Upload: $File = "D:\Dev\somefilename.zip" $ftp = "ftp://username:password@example.com/pub/incoming/somefilename.zip" "ftp url: $ftp" $webclient = New-Object System.Net.WebClient $uri = New-Object System.Uri($ftp) "Uploading $File..." $webclient.UploadFile($uri, $File)
//Download: $File = "c:\store\somefilename.zip" $ftp = "ftp://username:password@example.com/pub/outbound/somefilename.zip" "ftp url: $ftp" $webclient = New-Object System.Net.WebClient $uri = New-Object System.Uri($ftp) "Downloading $File..." $webclient.DownloadFile($uri, $File)
Ftp with PowerShell = ftp-ls.ps1 function DownloadFromFtp($destination, $ftp_uri, $user, $pass) function UploadToFtp($artifacts, $ftp_uri, $user, $pass) Usage samples $ftp_uri = "ftp://127.0.0.1/" $ftp_user = "web" $ftp_pass = "web" $artifacts = "c:\artifacts" $backup = "c:\backups\current" //upload UploadToFtp $artifacts $ftp_uri $ftp_user $ftp_pass //download DownLoadFromFtp $backup $ftp_uri $ftp_user $ftp_pass