【问题标题】:Check-out/in files on TFS via PowerShell通过 PowerShell 在 TFS 上签出/签入文件
【发布时间】:2011-05-27 03:10:50
【问题描述】:

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

有人知道怎么做吗?

【问题讨论】:

    标签: powershell tfs


    【解决方案1】:

    我和你有同样的痛苦,终于找到了正确的方法。 给你。

    #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
    

    【讨论】:

      【解决方案2】:

      您可以使用New-TfsChangeSet cmdlet 签入并使用Add-TfsPendingChange -Edit cmdlet 签出。

      要获取 cmdlet,您必须安装 Microsoft Team Foundation Server 2010 Power Tools。

      【讨论】:

      猜你喜欢
      • 2016-01-23
      • 2021-03-09
      • 1970-01-01
      • 2012-11-21
      • 2021-01-10
      • 2023-04-02
      • 2013-06-02
      • 2010-09-17
      • 2017-05-06
      相关资源
      最近更新 更多