AbelMorgan
AbelMorgan

Reputation: 411

How to launch a powershell script in my TFS build - 2013

I am trying to do a TFS's build in my remote server. Usually I am doing my template.xml with visual studio, dragging and dropping some kind of box.

If I am not wrong I should to declare a variable named ScriptDetails, that is cointained in a box called RunDeploymentScript. However there are some errors

1) ScriptDetails need always an argument or something, I get this kind of error

Value for a required activity argument 'ScriptDetais' was not supplied. Parameter name: rootArgumentValues

I tried to set in the "constructor" my script path inside my solution project, but then I get other error, "Too many argument in ScriptDetails constructor".

2) I had been read the whole internet but I didn't find any information, tutorial or example about how to do this, so please, don't copy/paste links here that you googled it, because for sure I've read all of them.

When I add these box in my build configuration I can see some options that do a reference to my variables declared in my template.xml but ScriptDetails is disabled to work with this configuration.

I have no idea about what more to do, I just need to build a project and launch 2 scripts in powerwhell language.

Thank you and greetings.

Upvotes: 0

Views: 435

Answers (2)

Vicky - MSFT
Vicky - MSFT

Reputation: 5010

The RunDeploymentScript activity is an important build activity used in LabDefaultTemplate, value of the ScriptDetails is script detail object for a lab system. So, this build activity is not used to run PowerShell script.

Just as MrHinsh mentioned above, you can specify the PowerShell script you want to run in Post/Pre-build script part. Please check these two links for the details:

https://msdn.microsoft.com/en-us/library/dn376353(v=vs.120).aspx http://blog.nwcadence.com/whats-new-in-tfs-2013-team-builds-are-able-to-run-in-powershell/

Upvotes: 0

Launching PowerShell scripts is out of the box in 2013.

Make sure that you are using the latest .xaml template from the pick-list And you should see Pre-build and post-build PowerShell locations listed as properties.

If you have two PowerShell then just merge them into one or have a third script that Calles your two...

Upvotes: 1

Related Questions