Skip to content

Instantly share code, notes, and snippets.

@mhudasch
Last active February 14, 2019 09:23
Show Gist options
  • Save mhudasch/6807e98a005b2bab0334c95436aa5476 to your computer and use it in GitHub Desktop.
Save mhudasch/6807e98a005b2bab0334c95436aa5476 to your computer and use it in GitHub Desktop.
Uninstalles all nuget packages from all projects in a solution
@( Get-Project -All | ? { $_.ProjectName } | % { Get-Package -ProjectName $_.ProjectName } ) | %{ $_ | Add-Member -MemberType "NoteProperty" -Value "$($_.Id)@$($_.Version)" -Name "Key"; $_ } | Sort -Property "Key" -Unique | %{ Uninstall-Package -Id $_.Id -ProjectName $_.ProjectName -Force -RemoveDependencies -ErrorAction Ignore }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment