Skip to content

Instantly share code, notes, and snippets.

@GraemeF
Forked from damianh/RestorePackages.ps1
Created July 31, 2011 11:47
Show Gist options
  • Save GraemeF/1116727 to your computer and use it in GitHub Desktop.
Save GraemeF/1116727 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 i $packageConfig.FullName -o Packages
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment