Created
September 22, 2015 11:17
-
-
Save MartinBodocky/1d90575e194add9a9119 to your computer and use it in GitHub Desktop.
The script will reinstall all nuget packages installed in your project.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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