Skip to content

Instantly share code, notes, and snippets.

@damianh
Created March 31, 2011 14:35
Show Gist options
  • Save damianh/896457 to your computer and use it in GitHub Desktop.
Save damianh/896457 to your computer and use it in GitHub Desktop.
PowerShell script to restore a projects packages and tools. Requires nuget.exe to be in the project root and commited to source control.
# Tools
.\NuGet.exe i DotCover -s \\myserver\Dev\NuGetPackages -o Tools
.\NuGet.exe i StyleCopCmd -s \\myserver\Dev\NuGetPackages -o Tools
# Dependecies
$packageConfigs = Get-ChildItem . -Recurse | where{$_.Name -eq "packages.config"}
foreach($packageConfig in $packageConfigs){
Write-Host "Restoring" $packageConfig.FullName
.\nuget.exe i $packageConfig.FullName -o Source\Packages
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment