Skip to content

Instantly share code, notes, and snippets.

@andrulik
Forked from vansha/get-packages.ps1
Created February 22, 2012 19:10
Show Gist options
  • Save andrulik/1886698 to your computer and use it in GitHub Desktop.
Save andrulik/1886698 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