Last active
February 14, 2019 09:23
-
-
Save mhudasch/6807e98a005b2bab0334c95436aa5476 to your computer and use it in GitHub Desktop.
Uninstalles all nuget packages from all projects in a solution
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
@( 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