【发布时间】:2011-05-27 03:10:50
【问题描述】:
我想使用 PowerShell 自动将已编辑的 .csproj 文件签出和签入到 TFS。我只需要将单个文件更改为待处理并签入。
有人知道怎么做吗?
【问题讨论】:
标签: powershell tfs
我想使用 PowerShell 自动将已编辑的 .csproj 文件签出和签入到 TFS。我只需要将单个文件更改为待处理并签入。
有人知道怎么做吗?
【问题讨论】:
标签: powershell tfs
我和你有同样的痛苦,终于找到了正确的方法。 给你。
#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
【讨论】:
您可以使用New-TfsChangeSet cmdlet 签入并使用Add-TfsPendingChange -Edit cmdlet 签出。
要获取 cmdlet,您必须安装 Microsoft Team Foundation Server 2010 Power Tools。
【讨论】:
add-pssnapin Microsoft.TeamFoundation.PowerShell。