gpt4 book ai didi

powershell - 设置TFS内部版本号PowerShell

转载 作者:行者123 更新时间:2023-12-02 23:27:36 25 4
gpt4 key购买 nike

我知道类似的问题已经存在,但是我找不到合适的答案。

我的问题是:是否可以使用PowerShell在TFS中设置新的内部版本号?

我想创建内部版本号并通过PowerShell进行设置。我想要那样,没有其他解决方案。

谢谢

最佳答案

这个怎么样?

# Change the following to your TFS collection and build URIs...
# These environment variables will exist during TFS builds
[String] $CollectionUrl = "$env:TF_BUILD_COLLECTIONURI"
[String] $BuildUrl = "$env:TF_BUILD_BUILDURI"

# Get the Team Project Collection:
$teamProjectCollection = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($CollectionUrl)

# Connect to the TFS build service:
$buildServer = $teamProjectCollection.GetService([Microsoft.TeamFoundation.Build.Client.IBuildServer])

# Get the build detail:
$buildDetail = $buildServer.GetBuild($BuildUrl)

# Updating the TFS build number with an example SemVer:
$buildDetail.BuildNumber = "1.2.3-alpha1"

# Make sure to save the changes:
$buildDetail.Save()

关于powershell - 设置TFS内部版本号PowerShell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30337124/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com