Every monday, our team merges the dev-Branch to a "main"-branch, which is used by our test-team for testing purposes. You could say, that every monday our main branch has exactly the same files as our dev branch.
I am thinking of automating this task. I would like to create a build definition. The definition will run every sunday, build my dev-Branch and if it succeeds, it will automatically merge all changes made during that week to the main-branch.
I found a script: https://geekygulati.com/2013/02/17/automerging-in-tfs/ but it's not designed for TFS-build script, more for independent systems.
So I would like to know, if there is any easy way with the TFS, I am not a great expert. Any suggestions on how to do it? I am sure there are alot of ways to achieve something like that, I would like to know, how you would do it?
If you are using TFS 2013 or higher I believe you have an option to run a PowerShell script after the build. You could use this extension point to run the script you referenced.
It sounds like you are more advanced in your development practices. I would suggest working from a single Main branch all the time. We cautiously made this transition 2 years ago and have loved it. This was our first big step to Continuous Delivery. The trick is you have to make sure your changes are "Release Ready". Check it out - https://dotnetcatch.com/2016/02/16/are-you-release-ready/