Skip to content

Instantly share code, notes, and snippets.

@ArildF
Created May 27, 2011 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArildF/995351 to your computer and use it in GitHub Desktop.
Save ArildF/995351 to your computer and use it in GitHub Desktop.
Create common bin directories through symlinks
param($linkTarget={throw "Link target must be specified"}, $rootDir=".")
ls $rootDir -Recurse -Include *.csproj | % { $_.DirectoryName } | % { Join-Path $_ -ChildPath "bin" } | % {
Write-Host "Creating link from $_ to $linkTarget"
if (Test-Path $_)
{
Remove-Item -Force -Recurse $_
cmd /c rd $_
}
cmd /c mklink /D $_ $linkTarget
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment