Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 3

Append PATH on Windows

Solved! Go to Solution.

I'm trying to install https://scoop.sh/, but I fail to add it to the PATH environment variable for subsequent steps. I tried:

 

set PATH=C:\Users\runneradmin\scoop\shims;%PATH%

 

 

and

 

[Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::Machine)

(with a modified $env:Path).

 

When I print the PATH variable in the next step, it always remains unchanged. What's the correct way to do this?

2 Replies
Solution
GitHub Staff
Message 2 of 3

Re: Append PATH on Windows

Each step is run its own process space so environment changes do not automatically propgate.  If you want to update the path you can use the `add-path` command as documented https://help.github.com/en/articles/development-tools-for-github-actions#add-a-system-path-add-path.  

Copilot Lvl 2
Message 3 of 3

Re: Append PATH on Windows

Thanks a lot, this worked without problems!

 

I saw this page before but somehow thought that it only applied to the Node.js toolkit.