How to get SystemRoot folder during TFS Build

Getting the System Root Directory during TFS Build was not straightforward as I thought, so I decide to share my experience on how to get that.

  • I used InvokeMethod activity, in the Target Type I will put the name of the static class that has the method I need use.
  • In MethodName, I will put GetEnviornmentVariable.
  • Write the value to the build log by calling WriteBuildError and past the value return from GetEnviornmentVariable.

6-25-2014 12-53-38 PM

6-25-2014 12-58-59 PM

For InvokeMethod activity, if I need to call a method from an instance object then I will use Target Object not Target Type.



Share This: