Hello,
I have this script:
cls [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Client") [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Build.Client") [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.Build.Common") [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.TeamFoundation.WorkItemTracking.Client") $tfsCollectionUrl = "http://zdev:8080/tfs/dev_test_collection" $teamProjectCollection = [Microsoft.TeamFoundation.Client.TfsTeamProjectCollectionFactory]::GetTeamProjectCollection($tfsCollectionUrl) Write-Host "Team Project Collection: "$teamProjectCollection $ws = $teamProjectCollection.GetService([type]"Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore") write-host "WorkItemStore: "$ws $buildServer = $teamProjectCollection.GetService([Microsoft.TeamFoundation.Build.Client.IBuildServer]) Write-host "Build Server: "$buildServer $buildDetail = $buildServer.QueryBuilds("ms-basis dev", "Staging_Test_DEV") | ` where { $_.BuildNumber -eq "Staging_Test_DEV_20130604.1" } Write-Host "Buildnumber: "$buildDetail.BuildNumber Write-Host "Drop Location: "$buildDetail.DropLocation Write-Host "Retain Indefinitely bevore: "$buildDetail.KeepForever $buildDetail.KeepForever = "false" Write-Host "Retain Indefinitely after: "$buildDetail.KeepForever $buildDetail.Save()
I want to change the Retain Indefinitely with this script to false. But the script doesn't change the value.
When I change this Retain Indefinitely to false with Visual Studio, I have to confirm this action.
How can i confirm this action automatically with at powershell.
This $buildDetail.Save() -confirm:$true does not work.
The other way, change the Build Retain Indefinitely from false to true works with this script!
I hope somebody can help me,
Thanks Horst MOSS 2007 Farm; MOSS 2010 Farm; TFS 2010; IIS 7.5