Created
June 14, 2018 07:18
-
-
Save jskyzero/e809d6a6aa38cd115ab7e652345b3956 to your computer and use it in GitHub Desktop.
PowerShell Default Profile in ~/Documents/WindowsPowerShell
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
# jskyzero windows powershell config | |
# for cd *.ink | |
remove-item alias:cd -force | |
function cd($target) | |
{ | |
if($target.EndsWith(".lnk")) | |
{ | |
$sh = new-object -com wscript.shell | |
$fullpath = resolve-path $target | |
$targetpath = $sh.CreateShortcut($fullpath).TargetPath | |
set-location $targetpath | |
} | |
else { | |
set-location $target | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment