Created
February 21, 2014 16:08
-
-
Save kdoblosky/9137055 to your computer and use it in GitHub Desktop.
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
# Useful $profile addition | |
# If my current location is at a long path elsewhere, and I need to | |
# switch to C:\Scripts for a moment, I can do this: | |
# | |
# $ > ~ | |
# Do whatever I need to do in E:\Scripts | |
# $ > pop | |
# And I'm now back at my original location | |
# Set a folder to be considered "Home" | |
# Push current location to the location stack, then go to the home folder | |
Function Set-LocationHome() { | |
Push-Location | |
Set-Location E:\Scripts | |
} | |
Set-Alias -Name ~ -Value Set-LocationHome | |
Set-Alias -Name pop -Value Pop-Location | |
Set-Alias -Name push -Value Push-Location | |
# Now, if I'm at a long path elsewhere, and need to switch to C:\Scripts for a moment, I can do this: | |
# | |
# $ > ~ | |
# Do whatever I need to do in E:\Scripts | |
# $ > pop | |
# And I'm now back at my original location |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment