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 does not appear to be working



  • I have created an Application Powershell Asset to set environment variables as follows:
    [Environment]::SetEnvironmentVariable("TC_SSO_APP_ID","TEST1","Machine")
    [Environment]::SetEnvironmentVariable("TC_SSO_SERVICE","TEST2","Machine")
    [Environment]::SetEnvironmentVariable("TC_SSO_LOGIN_URL","TEST3","Machine")

    When I execute the packaged pipeline process, it appears that the script executed successfully. There is no output of this process, and I have verified that errors in the script are caught.

    When I login to the server and open a PowerShell/CMD prompt however, the expected values are not set. I'm not sure what I am doing wrong and from other examples, this should be working.

    Product: BuildMaster
    Version: 5.7.3



  • There is nothing in particular that BuildMaster would do that would prevent this powershell script from running.

    But since you're trying to create a machine-level environment variable, presumably from a different user than you are logging in as (agent username vs your username), you may need to reboot your machine in order for it to appear in the command prompt. Or at least log-out with your name.



  • Hi Alana,

    Thanks for your reply. I ended up submitting a bug Ticket which I need to respond to. But in response to your comment, The Agent and the runtime user are both the same account. Aside from the simple script above, I also tried to get it to return the value, and it would only return 's' in once case, error in another , or indicate the value was part of a Dictionary, which I'm guessing is meaning its within an array.

    Tod Hoven is my contact for the issue that I will be working with, but at the moment my BuildMaster instance is offline, so I will be following-up once our environment is back online.

    I'll try and remember to update this thread with the fix once we have it...

    -Trent



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation