Skip to content

Instantly share code, notes, and snippets.

@igorpopovio
Created August 17, 2015 13:01
Show Gist options
  • Save igorpopovio/7e7a09855a697b1944c3 to your computer and use it in GitHub Desktop.
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)
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