You may want to turn on and off the PATH
environment variable, for example, when you use UNIX tools with MSYS2.
It's annoying like this.
» $prevPath = $Env:Path
» $Env:Path = "$Env:MSYS2\bin;$Env:MSYS2\mingw64\bin;$Env:Path"
» # do some work with MSYS2
» $Env:Path = $prevPath
Or you may want to change each version of compilers.
powershell-path-switcher supports this.
kakkun61 / powershell-path-switcher
Path Environment Variable Quick Switcher
Interactive select
A quick view is at this video.
Prepare a configuration file,
# $Env:ProgramData\powershell-path-switcher\config.yaml
msys2-usr: C:\tools\msys64\usr\bin
msys2-mingw64: C:\tools\msys64\mingw64\bin
and invoke Switch-Path
.
» Switch-Path
> [ ] msys2-usr: C:\tools\msys64\usr\bin
[ ] msys2-mingw64: C:\tools\msys64\mingw64\bin
You can move its cursor (>
) up/down with ↑/↓ keys, select (check by x
) with the space key and reflect with the enter key.
When you want to remove a specified path from the PATH
variable, you can delete it by removing its check mark (x
).
For more information see a README.
Top comments (0)