Skip to content

Instantly share code, notes, and snippets.

@AKuederle AKuederle/get_path.ps1
Last active Aug 29, 2015

Embed
What would you like to do?
Get and refresh the currently avaible path inside a PowerShell session (usefull, when troubleshooting or installing things from the shell)
# prints the current path avaible in the PowerShell
function path
{
$curr = Get-Location
cd env:
(ls path).value.split(“;”)
cd $curr
}
# 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
You can’t perform that action at this time.