I have added a custom variable to my build in TFS 2015, however, this variable does not appear in the environment variables when the build is run. I have verified this by running
Get-ChildItem Env:
in the PowerShell script. There is plenty of documentation about the predefined build variables, but the documentation for how to access custom variables is pretty disappointing. Any help would be appreciated.
So I figured it out.
I initially named my variable OCTOPUS_API_KEY
. I figured since I would only be accessing it as an environment variable I might as well use the env var naming convention.
Apparently, the names of the custom variables that you define get transformed by some internal undocumented rule described here.
So based on this, I renamed the variable to octopus.api.key
and it was properly transformed to the OCTOPUS_API_KEY
environment variable and included in the build.
It would seem that the transformation applied to variable names to make them env var friendly doesn't actually handle variables that are already in the right format.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With