Created
February 9, 2020 08:14
-
-
Save Hashbrown777/d3101059b25cf957f9f6a2ed7502b957 to your computer and use it in GitHub Desktop.
resets an environment variable to what it would be if you opened a new prompt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function resetEnv { | |
Set-Item ` | |
-Path (('Env:', $args[0]) -join '') ` | |
-Value (( | |
[System.Environment]::GetEnvironmentVariable($args[0], "Machine"), | |
[System.Environment]::GetEnvironmentVariable($args[0], "User") | |
) -match '.' -join ';') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
console - Reload the path in PowerShell - Stack Overflow
https://stackoverflow.com/questions/17794507/reload-the-path-in-powershell/56033268#56033268