Last active
August 29, 2015 14:14
-
-
Save AKuederle/509b5710445cb9706155 to your computer and use it in GitHub Desktop.
Get and refresh the currently avaible path inside a PowerShell session (usefull, when troubleshooting or installing things from the shell)
This file contains 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
# prints the current path avaible in the PowerShell | |
function path | |
{ | |
$curr = Get-Location | |
cd env: | |
(ls path).value.split(“;”) | |
cd $curr | |
} |
This file contains 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
# refreshs the current path and refreshs the profile script to consider any path manipulation made there. | |
function refpath | |
{ | |
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") | |
. $PROFILE | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment