Share →
Buffer

One of the new features that I really like in the TFS 2013 is the ability to run scripts using the Default template. This is a huge time saver! Before we had to create a custom activity to call the scripts and pass in the parameters.

Lets get start on showing you this new feature of running the PowerShell script in the Default template

Add a PowerShell script to your source control

clip_image002

In TFS 2013 | Team Explorer | Builds | Right click a build definition | Select Edit Build Definition | The Build definition properties for the build will open.

In the Build definition properties | Select the Source Settings | Make sure that the script is added to the working folder

clip_image004

In the Build definition properties | Click on Process | The Build Process template will open

clip_image006

In 2. Build section | Expand 5. Advanced | the MSBuild, Post and Pre script will show.

Add the location of the script and any parameters the script requires

Run the build and verify the results

In the build results | Click on Diagnostics | Click on View Logs | The Diagnostics web page will open

clip_image008

clip_image010

Verify that your script ran as expected

Conclusion

The new features of being able to run script from the default template give great flexibility and time saving in build-out a robust continuous workflow. Now I add my pre and postscripts to update my target environment or to preform cleanup tasks.

 

 

image

Print Friendly
Tagged with →