使用tf.exe从现有标签创建新标签

时间:2019-05-23 16:15:06

标签: powershell tfs

在Visual Studio中,可以从与现有标签关联的文件中创建新的源代码管理标签。

我如何使用tf.exe在Powershell脚本中执行此操作?

1 个答案:

答案 0 :(得分:0)

这可以通过/version命令上的tf.exe label参数来实现。

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
相关问题