Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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

    Scheduled Pinned Locked Moved Support
    powershellenvironmentsbuildmasterwindowsvariables
    3 Posts 1 Posters 23 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          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

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post
          Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation