How to use a powershell script as environment file for toolchains?


I really like the ability to add an environment file (script) to the toolchain that calculates the necessary environment variables for the system and sets them accordingly. Unfortunately, it is not currently possible to add a powershell script, as it seems that the file is only called from a command line under Windows (perhaps with the `call` command?).

Since batch files are a bit old fashioned and I would like to use powershell capabilities for my environment files as well, how is it possible to add a powershell script as a toolchain environment file?

Using a batch file to call a Powershell file won't work because a child process can't set environment variables for its parent.

1 comment


Thank you for the post. I created a feature request - Feel free to comment or upvote the issue in order to get updates. See if you are not familiar with YouTrack.


Please sign in to leave a comment.