I am trying to add my project directory to GOPATH, in linux I can do
export GOPATH=$HOME/mygo in ~/.bashrc
what is the equivalence in powershell
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This should follow the way you set any Environment variable with Powershell (as described in this article):
If you want it permanent (ie will apply for any future shell):
If you want it for just the current shell, as mentioned in cmotley‘s answer and detailed in the same article:
As Jaykul comments, setting that line in your
%UserProfile%\My Documents\WindowsPowerShell\profile.ps1is the equivalent of an export in~\.bashrc:See “Windows PowerShell Profiles“.
(There are actually 4 profiles, the one profile mentioned applies only to the current user, but affects all shells)