Skip to content

Instantly share code, notes, and snippets.

@MartinMiles
Created April 1, 2019 19:10
Show Gist options
  • Save MartinMiles/7798533833ec60963161ba88f59a4484 to your computer and use it in GitHub Desktop.
Save MartinMiles/7798533833ec60963161ba88f59a4484 to your computer and use it in GitHub Desktop.
Uploads local file to remote FTP from PowerShell
$File = "c:\Projects\output.zip"
$ftp = "ftp://erad-test-sitecore-615907-single\eradFTP:PA55W0RD@waws-prod-ln1-013.ftp.azurewebsites.windows.net/site/deployments/output.zip"
"ftp url: $ftp"
$webclient = New-Object System.Net.WebClient
#$uri = New-Object System.Uri($ftp)
$uri = [uri]::EscapeUriString($ftp)
"Uploading $File..."
$webclient.UploadFile($uri, $File)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment