Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Set windows environment variable



  • How do I set a windows environment variable from buildmaster?

    I assumed that a buildmaster variable would be accessible from a windows script in the same way that they are in Jenkins but this doesn't seem to be the case.

    I'm trying to set http_proxy=<proxy> and EnableNuGetPackageRestore=true to allow NuGet to download items on the build server.



  • The easiest way would be using the PowerShell action with the script:

    [Environment]::SetEnvironmentVariable("EnvironmentVariableName", "%BUILDMASTER-VARIABLE%", "User")

    Where "User" means user-level environment variable (specifically for the user running the BuildMaster service). The other options for the 3rd argument are "Machine" and "Process".



  • That half worked, the environment variable has been set (I can log on to the server and echo the value) but if I try to use the environment variable from a script called by buildmaster then the no value is returned.

    Why can't I use this value from a script called by buildmaster?



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation