title: TFS 2010: run powershell script stored in source control
body: <p>We've started using TFS2010 over at the company I work at. We create e-commerce web applications (shopping sites). I'm creating a custom template to deploy web projects after a build using a build template.
  I've looked at the web deploy tool, but MSDN seems to indicate that it can only do initial deployments, and I need to be able to do incremental deployments with the same script.</p>
  
  <p>I'm thinking of using the invokeActivity activity in the template to use powershell to do the job by specifying an FTP script which automatically copies the output of a build to a designated FTP site and then runs the SQL (upgrade) scripts, if needed by using SSH or s powershell remoting interactive session. (possibly specified in a separate SQL script)</p>
  
  <p>There is some unknown for me which I can't get clear through the use of google:</p>
  
  <p>When queuing a build, will I be able to let the user specify a script present in source control ( e.g. <code>$(source)\scripts\ftpscript.ps1</code> ) as the script which is to be used? Will powershell be able to access/use that file? or should I copy it to the build directory and specify when I run it? (I don't know how to set up the template to get files from source control, so a pointer to some helpful info how to do that would be very much appreciated)</p>
  
  <p>If the previous just doesn't work at all, could I create a folder \scripts\ in my website project, commit that to source control and then use <code>BuildDetail.DropLocationRoot &amp; "\scripts\"</code> as the location for the script and fore a copy of the script files by enabling the force copy option?</p>