简体   繁体   中英

Get Latest version of a project from tfs using powershell

I am trying to automate our routine developer tasks using powershell. I am halfway through with my powershell script.

I want to get latest version of a particular project from TFS. Developer will have access to several project in TFS. Out of those projects, files under specific project needs to be updated.

I will be running powershell script on developer's machine where TFS path is already set and developer has permission to access TFS. I googled it for a while, but could not get the answer.

Here is the way I use :

1) You have to install Microsoft Visual Studio Team Foundation Server 2012 Power Tools . you need to install the Windows PowerShell cmdlets.

  • The Windows PowerShell cmdlets need the .NET Framework 3.5 Windows Feature installed.

  • Windows PowerShell Execution Policy needs to be configured. Restricted Execution Policy does not work.

在此输入图像描述

2) After installing the prerequisites, you can use version control.

Open the Windows PowerShell console, and then load the Team Foundation cmdlets from the Visual Studio Team Foundation Server 2012 Power Tools.

Get-PSSnapin –Registered
Add-PSSnapin Microsoft.TeamFoundation.PowerShell

The easy way is to have a workspace mapping multiple projects and run the tf get command from Powershell. TF allows you to manage workspaces also, so with couple of lines you get what you are looking for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM