0
votes

I am using TFS2015 Release Management and Powershell DSC to manage the deployment of applications - previously I was using RM2013.

One thing I have noticed is that in RM2013, in my Powershell DSC scripts I was able to access variables such as $applicationPath - which was populated with the TFS Build Drop location, for use in the DSC scripts and MOF creation.

In RM2015 it doesn't appear that this works? I have tried using the variables listed here: https://msdn.microsoft.com/en-us/Library/vs/alm/Build/scripts/variables

However none of these ever seem to be populated?

Is there actually a way of using these RM2015 system & build variables from within a PS DSC script now?

Kind regards

1

1 Answers

0
votes

Try to use the corresponding generated environment variables (for example $env:Build.DefinitionName).

If it not work try more ways such as $env:Build_DefinitionName or $(Build.BuildNumber) and $(Build_BuildNumber)

Just as the relevant documentation mentioned:

Any text input can reference a variable by using the $(variable_name) syntax and will be substituted with the actual value at run-time. All variables are also exported to the environment as upppercase and any . are replaced with _. In scripts you can reference variables via the environment, i.e. %VARIABLE_NAME%, $VARIABLE_NAME, $env:VARIABLE_NAME, depeding on the operating system.