Difference between revisions of "Modifying the PATH in Powershell"

From MyWiki
Jump to: navigation, search
(Created page with "<source lang="text"> If, some time during a PowerShell session, you need to modify the PATH environment variable temporarily, you can do it this way $env:Path = $env:Path +...")
 
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
  
If, some time during a PowerShell session, you need to modify the PATH environment variable temporarily, you can do it this way
+
If, some time during a PowerShell session, you need to modify the PATH environment variable temporarily,
 +
you can do it this way
  
 
$env:Path = $env:Path + ";C:\Program Files\GnuWin32\bin"
 
$env:Path = $env:Path + ";C:\Program Files\GnuWin32\bin"
Line 9: Line 10:
  
 
$env:Path += ";C:\Program Files\GnuWin32\bin"
 
$env:Path += ";C:\Program Files\GnuWin32\bin"
 +
 +
$env:Path =  "C:\cygwin64\bin;" +  $env:Path  ### didn't work for me
 +
  
  
  
 
</source>
 
</source>

Latest revision as of 10:38, 1 March 2016

If, some time during a PowerShell session, you need to modify the PATH environment variable temporarily,
 you can do it this way
 
$env:Path = $env:Path + ";C:\Program Files\GnuWin32\bin"
 
Or even shorter as per Kevin’s comment
 
$env:Path += ";C:\Program Files\GnuWin32\bin"
 
$env:Path =  "C:\cygwin64\bin;" +  $env:Path  ### didn't work for me