Skip to content

Instantly share code, notes, and snippets.

@vansha
Created August 16, 2011 20:33
Show Gist options
  • Save vansha/1150094 to your computer and use it in GitHub Desktop.
Save vansha/1150094 to your computer and use it in GitHub Desktop.
Download all packages for the solution via NuGet
$scriptDir = split-path $script:MyInvocation.MyCommand.Path
$nuget = "$scriptDir\tools\NuGet.exe"
$packagesDir = "$scriptDir\src\Packages"
$packagesConfigs = get-content "$packagesDir\repositories.config" `
| select-string -pattern "<repository path=" `
| foreach { $_ -replace "\s*<repository path=""", """$packagesDir\" } `
| foreach { $_ -replace "\s*/>" }
foreach ($pathToPackagesConfig in $packagesConfigs)
{
& $nuget install $pathToPackagesConfig -o $packagesDir
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment