Confirm save command
hello,
i have 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 change retain indefinitely script false. script doesn't change value.
when change retain indefinitely false visual studio, i have confirm action.
how can confirm action automatically @ powershell.
this $builddetail.save() -confirm:$true not work.
the other way, change build retain indefinitely false true works script!
i hope can me,
thanks horst moss 2007 farm; moss 2010 farm; tfs 2010; iis 7.5
"false" string, should boolean value:
# line: $builddetail.keepforever = "false" # should be: $builddetail.keepforever = $false
and save() has parentheses , apparently not cmdlet method. cannot use powershell parameter after it.
Windows Server > Windows PowerShell
Comments
Post a Comment