【发布时间】:2019-10-10 06:27:03
【问题描述】:
在 Visual Studio 中,可以从与现有标签关联的文件中创建新的源代码管理标签。
我将如何在 Powershell 脚本中使用 tf.exe 执行此操作?
【问题讨论】:
标签: powershell tfs
在 Visual Studio 中,可以从与现有标签关联的文件中创建新的源代码管理标签。
我将如何在 Powershell 脚本中使用 tf.exe 执行此操作?
【问题讨论】:
标签: powershell tfs
这可以通过tf.exe label 命令上的/version 参数实现。
Documentation 说明/version 参数的格式应为 L 后跟标签名称:
# Create an alias to tf.exe
Set-Alias tf "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe"
$labelName = "New label"
$labelComment = "Comment on new label"
$previousLabelName = "Nightly Build"
$sourceFolder = "C:\Folder\Containing Source\"
tf label $labelName $sourceFolder /comment:$labelComment /version:L$previousLabelName /recursive /child:Replace
【讨论】: