I'm trying to add a build trigger to a build configuration in an automated fashion through PowerShell and the TeamCity 8 REST API.
Using the following question as a reference, it would appear that what I am trying to do is possible:Adding a Trigger to a build configuration in TeamCity using the REST API
But, whenever I try to add the trigger to the build, using the following code, I get a (405) Method Not Allowed
error:
$triggerXML= "<trigger id=`"TriggerID`" type=`"buildDependencyTrigger`">
<properties>
<property name=`"afterSuccessfulBuildOnly`" value=`"true`"/>
<property name=`"dependsOn`" value=`"BuildID`"/>
</properties>
</trigger>"
$webclient.UploadString('http://teamcity:8111/httpAuth/app/rest/buildTypes/BuildID', "POST", $triggerXML)
Has anyone implemented this successfully using PowerShell?