Q:

Transferring files between two windows PCs programatically

I have a build server running windows 7 and an amazon test server running windows server 2012.
When I execute my build process which outputs a WAR file I then want to move this to a specific location on my test server for testing.  Currently I just drag and drop the WAR file onto my test server.  I want instead to be able to do this programatically via a powershell script.
I use TFS for my build process. Is this possible without having to install an FTP server on my test server?

A:

Your requirement can be achieved by adding Windows Machine File Copy task in your build definition. You can use this task to copy application files and other artifacts to remote machines:

If you want to use powershell script, you could refer to this blog:

If you are using the PowerShell 5.0, now the Copy-Item command
  supports copying files from one machine to another through -ToSession
  and -FromSession parameters. As the name suggests, the -ToSession
  parameter expects a session with the destination computer where the
  file will be copied. Check the following example:
$Session = New-PSSession -ComputerName PowerShellAzureMachine -Credential $cred
Copy-Item -Path C:\temp\localfile.txt -Destination C:\localfile.txt -ToSession $session

