Reputation: 2193
I have a large number of projects (300+) and I have Powershell module commands to build these. These PS modules are wrapping MsBuild.exe and working successfully at Command Prompt.
However, I am trying to find a way to fit these Build Commands into TFS so that I can schedule builds (Rolling builds) through TFS among team members.
So far, I am unable to start with some suitable option to use Powershell script/commands to call from TFS instead of Msbuild.
Only Solution Guessed: is that I might need to create some OurBuild.Proj file and use Msbuild tasks to specify our Powershell commands and then set OutBuild.proj file to build in my Build Definition.
But I'm not sure if Powershell scripts/commands can be called like that. Because those scripts would further call Msbuild.exe while setting the environment by calling "%VS100COMNTOOLS%"VsVars32.bat at start.
Can someone please give us a head-start or point to some good tutorial/guide?
Upvotes: 3
Views: 3590
Reputation: 115037
Since you're allowed to build your own Build process xaml file, you can make it look like anything you want. I find it easiest to open up the DefaultBuildProcessTemplate.xaml
in sourcecontrol and then start there. The basics like fetching sources, setting and selecting the build agent can be kept as is, but the logic around building projects, and probably running the tests, you can take out and customize to your hearts content. Calling a powershell script is actually pretty simple (you might want to have a look at the 2013 templates on how you might be able to set that up.
From a reporting perspective you might want to do some additional work to make sure that your platform and configuration are correctly transferred from the build to the call to MsBuild (inside your powershell), and normally Team Build will also supply a set of additional loggers to ensure that warnings and errors correctly end up in the datawarehouse.
Giving you a thorough answer that covers everything is going to be a lot of work, so please start from here and ask additional questions when you get stuck.
Recommended reading:
Upvotes: 4