【问题标题】:TFS Get Workspaces With Pending Changes on PowerShellTFS 在 PowerShell 上获取具有待定更改的工作区
【发布时间】:2019-03-10 08:44:43
【问题描述】:

我是 TFS 的新手,出于管理目的,我正在尝试获取所有 TFS 工作区及其在 PowerShell 上本地计算机中的待定更改。

我知道您可以使用以下方法获取工作区:

tf vc workspaces

还有与待定更改类似的内容:

tf vc  status

但是,我怎样才能获得每个工作区的待定更改?

谢谢。

【问题讨论】:

    标签: powershell tfs


    【解决方案1】:

    您可以使用下面的 PowerShell 脚本来获取每个工作区及其未决更改:

    #Set-Alias tf "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe" #For VS 2017
    
    Set-Alias tf "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TF.exe" #For Visual Studio 2015
    
    Write-Host "Workspaces in current local machine:`n" 
    
    tf workspaces
    
    Write-Host "`n`nPending changes for each workspace:"
    
    ForEach ($workspace in tf workspaces | Foreach {"$(($_ -split '\s+',2)[0])"} | select-string -Pattern 'Collection:|Workspace|""|----------------' -NotMatch )
    {
    
    Write-Host "Workspace Name:" $workspace
    tf status /workspace:$workspace 
    Write-Host `n 
    }
    

    此外,您还可以使用工具Team Foundation Sidekicks 来管理工作区和待处理的更改...在另一个线程中参考我的答案:Visual studio 2017 Team foundation server question on checking whose working on what files

    【讨论】:

    • 非常感谢,我会试一试的。
    • 事实上,它确实有效;还有一个 Visual Studio 2017 的插件可以完成这项工作marketplace.visualstudio.com/…
    猜你喜欢
    • 2016-02-25
    • 2018-05-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-08-04
    • 1970-01-01
    • 2011-12-06
    相关资源
    最近更新 更多