Reload the path in PowerShell

rob picture rob · Jul 22, 2013 · Viewed 67.2k times · Source

If I have an instance of PowerShell ISE running and I install something that modifies the PATH or I modify it in any way outside of PowerShell then I need to restart PowerShell for it to see the updated PATH variable.

Is there a way to reload the path from within PowerShell without restarting it?

Answer

mpen picture mpen · Aug 6, 2015

Just to bring Rob's comment to light:

$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")