setting environment variables from appveyor.yml

cameron.taggart's Avatar

cameron.taggart

29 Jun, 2015 07:27 PM

If you install programs that update environment variables, it appears you currently have to manually update the session. For example, I found this nice work-a-round to make Paket-Restore work after I install Paket.PowerShell. The install updates the PSModulePath, but it is not reflected in the current environment. It would be nice if this wasn't required, but this solution seems ok. Thoughts?

init:
  - choco install Paket.PowerShell -y
  - ps: "$env:PSModulePath = [Environment]::GetEnvironmentVariable('PSModulePath', 'Machine')"
clone_depth: 1
build_script:
  - ps: Paket-Restore
test: off
  1. Support Staff 1 Posted by Feodor Fitsner on 30 Jun, 2015 02:35 AM

    Feodor Fitsner's Avatar

    Chocolatey is run in a child process and whatever session variables it sets they don't affect parent process. However, those variables set on "computer" scope will be picked up if only agent process is restarted. So, I think what you are currently doing is OK.

  2. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:57 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac