Skip to content

Instantly share code, notes, and snippets.

@jskyzero
Created June 14, 2018 07:18
Show Gist options
  • Save jskyzero/e809d6a6aa38cd115ab7e652345b3956 to your computer and use it in GitHub Desktop.
Save jskyzero/e809d6a6aa38cd115ab7e652345b3956 to your computer and use it in GitHub Desktop.
PowerShell Default Profile in ~/Documents/WindowsPowerShell
# 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