通过 PowerShell 在 TFS 上签出/签入文件 [英] Check-out/in files on TFS via PowerShell

查看:43
本文介绍了通过 PowerShell 在 TFS 上签出/签入文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 PowerShell 自动将已编辑的 .csproj 文件签出和签入到 TFS.我只需要将单个文件更改为待处理并签入即可.

I'd like to use PowerShell to automate check-out and check-in of edited .csproj files to TFS. I only need to change single files to pending and check those in.

有人知道怎么做吗?

推荐答案

我和你一样痛苦,终于找到了正确的方法.给你.

I had the same pain you are having, and finally got to the right way of doing so. Here you go.

#Load the TFS powershell
Add-PSSnapin Microsoft.TeamFoundation.PowerShell
# the filePath should be in the format like C:\MyFodler\MyFile.txt
Add-TfsPendingChange -Edit -Item $filepath -Verbose -ErrorAction SilentlyContinue -wa 0
# Check in the file after changes.
New-TfsChangeset -Item $filepath -Verbose -Comment "Comment Here" -Override true

这篇关于通过 PowerShell 在 TFS 上签出/签入文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆