我正在使用TFS編輯構建定義,然後排隊。我擁有獲取構建服務器和構建本身所需的一切。我甚至可以對構建進行排隊,但是我不知道如何指定選項。構建是門控,當我手動排隊它們時,我必須指定「最新來源」,而不是「最新來源與擱置」,這似乎是默認設置。如何在Powershell中指定TFS構建選項?
下面是我在手動排隊構建時單擊的示例。
下面是我迄今編碼:
$teamProjectCollection = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection("$serverURI")
$bs = $teamProjectCollection.GetService([type]"Microsoft.TeamFoundation.Build.Client.IBuildServer")
$build = $bs.GetBuildDefinition("$project", "$template")
#Here is where I would do all of the build editing, but it's not important.
$request = $definition.CreateBuildRequest()
$bs.QueueBuild($request, 「None」)
此代碼的工作,但我不知道怎麼過來的「最新消息透露註明「最新源代碼」的選項與Shelveset「。誰能幫忙?
我會期待是否指定'$ request.ShelvesetName'或不會確定([link](https://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.build.client.ibuildrequest .shelvesetname%28v = vs.120%29.aspx?f = 255&MSPPError = -2147217396)) –