Sunday, March 20, 2011

The InvokeProcess workflow activity

With the new build engine based on Workflow 4 in Team Foundation Server 2010, creating build definitions and automatic builds became a lot easier. One of the most useful activities is the InvokeProcess activity. This activity offers the following important properties:

  • Arguments: the argument values you want to pass to the invoked process
  • FileName: name of the process you want to execute
  • WorkingDirectory: location from which the process should be invoked.


One feature that makes debugging a lot easier is that you can setup the activity for logging(by default nothing will be logged other than the command line invoked). If you expand the activity in the designer, you can see that the Standard and Error output is captured in two variables(stdOutput and stdError). You can then add the WriteBuildMessage and WriteBuildError activities by dragging them from the toolbox into the handler areas of the InvokeProcess activity.



Anonymous said...

How does this help anybody? There are no examples of how to implement InvokeProcess.

Bart Wullems said...

The InvokeProcess expects standard command line options. Xcopy is the most simple example.

MB said...

Why does InvokeProcess have its argument list as string. What if a I want to pass any other argument type?

James said...

there really arent any good examples on the net.. Have it call a powershell script or something..