Skip to content

Instantly share code, notes, and snippets.

@szul
Created January 21, 2016 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szul/ab92a6c8144a9a601fbe to your computer and use it in GitHub Desktop.
Save szul/ab92a6c8144a9a601fbe to your computer and use it in GitHub Desktop.
PowerShell Script for use with Team Foundation Server as a build step to transfer files. Assumes pscp.exe from the puTTY team.
param(
[string]$files,
[string]$username,
[string]$password,
[string]$url
)
try {
Start-Process 'C:\puTTY\pscp.exe' -ArgumentList('-sftp -v -r -hostkey "TARGET_SERVER_HOST_KEY" -l ' + $username + ' -pw "' + $password + '" ' + $files + ' ' + $url) -Wait
}
catch {
throw '[spsc.exe] failed to load, or the upload failed to process.'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment