Search code examples
powershellconsolepowershell-ise

Reload the path in PowerShell


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?


Solution

  • Just to bring Rob's comment to light:

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