Skip to content

Instantly share code, notes, and snippets.

@MartinBodocky
Created September 22, 2015 11:17
Show Gist options
  • Save MartinBodocky/1d90575e194add9a9119 to your computer and use it in GitHub Desktop.
Save MartinBodocky/1d90575e194add9a9119 to your computer and use it in GitHub Desktop.
The script will reinstall all nuget packages installed in your project.
# Reinstall Nuget Packages into project
$packageFile =(Resolve-Path ".\").Path + "\packages.config"
if(Test-Path -Path $packageFile)
{
# get only packages mentioned inside packages config
[xml]$xmlContent = Get-Content $packageFile
# packages
$packages = $xmlContent.SelectNodes("//packages//package")
foreach ($package in $packages)
{
Install-Package $package.id
Update-Package -reinstall $package.id
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment