New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify Environment Variables (for example $env:PSModulePath) on Linux #4341
Comments
Can I suggest that you change the title of your issue to reflect the fact that you're looking for PowerShell to introduce a profile-independent way to persistently define environment variables? A few thoughts:
|
I tried setting an environment variable like this on an Ubuntu machine: I was hoping this would edit the /etc/environment file to set the environment variable system wide. |
Unfortunately .NET Core have yet to implement a method to set environment variables in Unix systems. The documentation for those methods states that applying values to anything other than the current process is only supported on windows. |
Is there any update on this or any work around |
No, you'd need to file an issue in the https://github.com/dotnet/runtime repository to request the functionality be expanded for non-Windows operating systems. A workaround for now would be to modify the /etc/environment file directly instead.
|
I've written a function which can be used to accomplish this when running elevated (as |
Can we re-open this as this still seem to be an issue? |
Hi all,
I think it would be great if you can change Environment Variables (accessed for example by $env:Name or Get-ChildItem env:) on Linux.
For example to set there values a new configuration file in /etc ?
On Windows I can change for example PSModulePath and add a custom path. The only option on Linux is to create a profile ps1 file for all users.
Thank you.
The text was updated successfully, but these errors were encountered: