Created
January 21, 2016 20:03
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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