How can I retrieve specific files from TFS?

Con risposta How can I retrieve specific files from TFS?

  • Thursday, June 21, 2012 8:19 PM
     
     
    I work in a dev shop that uses TFS. I need to grab some .config files buried in a project directory. So far the best approach I have seen is to call tf.exe, but, I can't figure out how to retrieve the actual files. My goal is to write a little wrapper to pull the files to my local machine so I can add them to a deployment package.

All Replies

  • Sunday, June 24, 2012 10:14 AM
     
     Answered Has Code

    First you will probably find things easier with the TFS PowerShell snapin from the TFS PowerToys (it isn't included in the default install, you need to select from a custom install).

    Then load into a 32bit instance of PowerShell with:

    Add-PSSnapin 'Microsoft.TeamFoundation.PowerShell'

    Use:

    gcm -noun tfs*

    to see a list of cmdlets it provides.

    You can use Get-TFsItemProperty to examine individual source control items and Update-TfsWorkspace to add them to your wokspace (and thus get locally).


    Richard J Cox