Skip to content

Instantly share code, notes, and snippets.

@juristr
Created September 16, 2013 06:49
Show Gist options
  • Save juristr/6577345 to your computer and use it in GitHub Desktop.
Save juristr/6577345 to your computer and use it in GitHub Desktop.
Synchronize NuGet with VS project references
function Sync-References([string]$PackageId) {
get-project -all | %{
$proj = $_ ;
Write-Host $proj.name;
get-package -project $proj.name | ? { $_.id -match $PackageId } | % {
Write-Host $_.id;
uninstall-package -projectname $proj.name -id $_.id -version $_.version -RemoveDependencies -force ;
install-package -projectname $proj.name -id $_.id -version $_.version
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment