powershell - 使用 tf.exe 从现有标签创建新标签
问题描述
在 Visual Studio 中,可以从与现有标签关联的文件中创建新的源代码管理标签。
我将如何在 Powershell 脚本中使用tf.exe
?
解决方案
这可以通过命令 /version
上的参数来实现。tf.exe label
文档说明/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
推荐阅读
- xamarin - 传递命令参数以删除列表视图条目
- c++ - 如何使用 EvtQuery 函数查找日志文件的大小?
- django - 在 Django 中满足条件时如何不执行操作
- reactjs - firebase + create-react-app 托管错误
- amazon-dynamodb - 向表中添加更多列并在 dynamoDB JS shell 中输入值
- c# - 为什么 IAudioEndpointVolume::SetMute 不适用于 C# 互操作?
- c# - 如何使 winform 图表中的辅助 Y 轴可滚动?
- webpack - 使用 elm-assets-loader 创建 elm-app webpack 配置
- reactjs - 将输入掩码添加到 React DatePicker
- php - Elasticsearch 搜索结果过滤