【发布时间】:2016-05-30 17:57:47
【问题描述】:
我正在使用 Powershell 从 TFS 获取最新的构建标签,然后将最新的构建标签提取到特定目录中。
获取最新的构建标签可以正常工作,如下所示:
Set-Location -Path 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\'
$cmd = '.\tf.exe'
$arg1 = 'labels'
$arg2 = '/owner:*'
$arg3 = 'BLD_V3R11*'
$result = & $cmd $arg1 $arg2 $arg3 | Select-Object -Last 1
$result 将等于
BLD_V3R11_1234
所以现在我尝试像这样从该构建中获取所有文件到 c:\Compile 文件夹中
Set-Location -Path 'c:\Compile'
$cmd = 'C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\tf.exe'
$arg1 = 'get'
$arg2 = 'c:\Compile2\*'
$arg3 = '/recursive'
$arg4 = '/version:L' + $result
& $cmd $arg1 $arg2 $arg3 $arg4
但是没有从 TFS 中提取任何文件,并且调用返回“所有文件都是最新的。”
c:\Compile 中没有文件时,文件如何保持最新?
【问题讨论】:
标签: powershell tfs