Created
August 17, 2015 13:01
-
-
Save igorpopovio/7e7a09855a697b1944c3 to your computer and use it in GitHub Desktop.
Function to shorten path in case it's too long (doesn't require extra permissions for folders)
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 ShortenPath($longPath) { | |
$id = ([guid]::NewGuid() -split '-')[0] | |
$shortPath = "C:\temp\$id" | |
cmd /c mklink /D /J $shortPath $longPath | Out-Null | |
return $shortPath | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment