简体   繁体   English

使用powershell从tfs获取项目的最新版本

[英]Get Latest version of a project from tfs using powershell

I am trying to automate our routine developer tasks using powershell. 我正在尝试使用PowerShell自动执行我们的常规开发人员任务。 I am halfway through with my powershell script. 我的PowerShell脚本已经过了一半。

I want to get latest version of a particular project from TFS. 我想从TFS获得特定项目的最新版本。 Developer will have access to several project in TFS. 开发人员可以访问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. 我将在开发人员的机器上运行powershell脚本,其中已经设置了TFS路径并且开发人员有权访问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 . 1)您必须安装Microsoft Visual Studio Team Foundation Server 2012电动工具 you need to install the Windows PowerShell cmdlets. 您需要安装Windows PowerShell cmdlet。

  • The Windows PowerShell cmdlets need the .NET Framework 3.5 Windows Feature installed. Windows PowerShell cmdlet需要安装.NET Framework 3.5 Windows功能。

  • Windows PowerShell Execution Policy needs to be configured. 需要配置Windows PowerShell执行策略。 Restricted Execution Policy does not work. 受限制的执行策略不起作用。

在此输入图像描述

2) After installing the prerequisites, you can use version control. 2)安装先决条件后,您可以使用版本控制。

Open the Windows PowerShell console, and then load the Team Foundation cmdlets from the Visual Studio Team Foundation Server 2012 Power Tools. 打开Windows PowerShell控制台,然后从Visual Studio Team Foundation Server 2012电动工具加载Team Foundation cmdlet。

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. 简单的方法是让工作空间映射多个项目并从Powershell运行tf get命令。 TF allows you to manage workspaces also, so with couple of lines you get what you are looking for. TF还允许您管理工作区,因此您可以通过几行来获得所需的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Powershell在TFS中获取特定项目的最新版本。 - How to get latest version of specific project in TFS using Powershell. 使用Powershell从TFS获取最新版本的文件夹 - Get Latest Version of Folder from TFS, using Powershell 使用Powershell从tfs文件夹获取最新的检入文件 - Get the latest checkin files from a tfs folder using powershell TFS 2010 Powershell Get-TFSItemHistory 返回最旧版本而不是最新版本 - TFS 2010 Powershell Get-TFSItemHistory returning oldest version and not the latest 使用Powershell从TFS获取团队项目名称 - Get Team Project Names from TFS using Powershell 如何使用TFS Rest API版本3.2从TFS项目获取测试用例 - How to get test cases from TFS project using TFS rest api version 3.2 如何使用 PowerShell 从 TFS 获取注释? - How to get Annotation from TFS using PowerShell? 如何在PowerShell中编写脚本以运行Microsoft Visual Studio 2010 TFS“获取最新版本”? - How do I write a script in PowerShell to run Microsoft Visual Studio 2010 TFS “Get latest version”? 使用 PowerShell 抓取 HTML 页面 - 从 adobe 获取最新版本说明 - Web Scraping HTML page using PowerShell - Get latest release notes Version number from adobe 使用PowerShell脚本获取TFS集合/项目列表 - PowerShell script to get TFS collections/project list
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM