Created
March 8, 2017 19:02
-
-
Save letmaik/91dff56e160da34dc148a9cc46b93c69 to your computer and use it in GitHub Desktop.
Create symlinks to folders and files on Windows without admin privileges in Powershell
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
function symlink ([String] $real, [String] $link) { | |
if (Test-Path $real -pathType container) { | |
cmd /c mklink /j $link.Replace("/", "\") $real.Replace("/", "\") | |
} else { | |
cmd /c mklink /h $link.Replace("/", "\") $real.Replace("/", "\") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment