Refresh Environment Variables For Runner

I have a gitlab runner on a Windows 2016 server, using the powershell executor. If I modify the PATH environment variable on the server, the gitlab runner does not seem to pick the change up, and subsequent builds will still use the old PATH. Currently, I’m having to stop the runner process and restart it so that it starts using the updated PATH.

Is there an easier way to refresh the runner’s environment variables so that I don’t have to restart it every time?

Thanks

Hi,

a call to refreshenv before any job script is executed doesn’t help, I guess?

Cheers,
Michael

I don’t have chocolatey installed. I tried an equivalent from here https://stackoverflow.com/a/31845512 and it works, but I don’t really want to have to add it to the before_script of every one of my ci yml files.

Oh, sorry. I wasn’t aware that this sources from Chocolatey. I just discovered this a while ago in my dev VM :slight_smile:

May I suggest you’ll open a feature request in the runner project then, if not already existing?

Cheers,
Michael