Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ftp server
- $ftp = 'ftp://servername/site/wwwroot/'
- $username = 'username'
- $password = 'password'
- $destinationPath = "D:\home\site\wwwroot\"
- $webclient = New-Object System.Net.WebClient
- $webclient.Credentials = New-Object System.Net.NetworkCredential($username, $password)
- try
- {
- Write-Output "Uploading..."
- $webclient.UploadFile($ftp + "file.xml", $destinationPath + "file.xml")
- $result = 0
- }
- catch
- {
- Write-Output $_.Exception.Message -ForegroundColor Red
- $result = 1
- }
- Write-Output "Done!"
- # Reporting result to Azure
- exit $result
Add Comment
Please, Sign In to add comment