Nuget uninstall package with dependencies

Thought i share a nice command of using nuget.

Let’s say you installed a package with a whole bunch of dependencies, but to found out later that that’s not the package that you want… how do we get rid of the package dependencies altogether without running uninstall-package command one by one.

for example, we’re installing jquery.ui.all package

PM> Install-Package jquery.ui.all Attempting to resolve dependency 'jQuery.UI.Core.All (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Core (= 1.8.9)'. Attempting to resolve dependency 'jQuery (= 1.4.4 && < 1.6)'. Attempting to resolve dependency 'jQuery.UI.Core.Mouse (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Core.Widget (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Core.Position (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Interactions.All (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Interactions.Draggable (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Interactions.Droppable (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Interactions.Resizable (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Interactions.Selectable (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Interactions.Sortable (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Widgets.All (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Widgets.Accordion (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Widgets.Autocomplete (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Widgets.Button (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Widgets.Dialog (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Widgets.Slider (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Widgets.Tabs (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Widgets.Datepicker (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Widgets.Progressbar (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Effects.All (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Effects.Core (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Effects.Blind (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Effects.Bounce (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Effects.Clip (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Effects.Drop (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Effects.Explode (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Effects.Fade (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Effects.Highlight (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Effects.Pulsate (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Effects.Scale (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Effects.Shake (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Effects.Slide (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Effects.Transfer (= 1.8.9)'. Attempting to resolve dependency 'jQuery.UI.Themes.base (= 1.8.9)'. Successfully installed 'jQuery 1.4.4'. Successfully installed 'jQuery.UI.Core 1.8.9'. Successfully installed 'jQuery.UI.Core.Widget 1.8.9'. Successfully installed 'jQuery.UI.Core.Mouse 1.8.9'. Successfully installed 'jQuery.UI.Core.Position 1.8.9'. Successfully installed 'jQuery.UI.Core.All 1.8.9'. Successfully installed 'jQuery.UI.Interactions.Draggable 1.8.9'. Successfully installed 'jQuery.UI.Interactions.Droppable 1.8.9'. Successfully installed 'jQuery.UI.Interactions.Resizable 1.8.9'. Successfully installed 'jQuery.UI.Interactions.Selectable 1.8.9'. Successfully installed 'jQuery.UI.Interactions.Sortable 1.8.9'. Successfully installed 'jQuery.UI.Interactions.All 1.8.9'. Successfully installed 'jQuery.UI.Widgets.Accordion 1.8.9'. Successfully installed 'jQuery.UI.Widgets.Autocomplete 1.8.9'. Successfully installed 'jQuery.UI.Widgets.Button 1.8.9'. Successfully installed 'jQuery.UI.Widgets.Dialog 1.8.9'. Successfully installed 'jQuery.UI.Widgets.Slider 1.8.9'. Successfully installed 'jQuery.UI.Widgets.Tabs 1.8.9'. Successfully installed 'jQuery.UI.Widgets.Datepicker 1.8.9'. Successfully installed 'jQuery.UI.Widgets.Progressbar 1.8.9'. Successfully installed 'jQuery.UI.Widgets.All 1.8.9'. Successfully installed 'jQuery.UI.Effects.Core 1.8.9'. Successfully installed 'jQuery.UI.Effects.Blind 1.8.9'. Successfully installed 'jQuery.UI.Effects.Bounce 1.8.9'. Successfully installed 'jQuery.UI.Effects.Clip 1.8.9'. Successfully installed 'jQuery.UI.Effects.Drop 1.8.9'. Successfully installed 'jQuery.UI.Effects.Explode 1.8.9'. Successfully installed 'jQuery.UI.Effects.Fade 1.8.9'. Successfully installed 'jQuery.UI.Effects.Highlight 1.8.9'. Successfully installed 'jQuery.UI.Effects.Pulsate 1.8.9'. Successfully installed 'jQuery.UI.Effects.Scale 1.8.9'. Successfully installed 'jQuery.UI.Effects.Shake 1.8.9'. Successfully installed 'jQuery.UI.Effects.Slide 1.8.9'. Successfully installed 'jQuery.UI.Effects.Transfer 1.8.9'. Successfully installed 'jQuery.UI.Effects.All 1.8.9'. Successfully installed 'jQuery.UI.Themes.base 1.8.9'. Successfully installed 'jQuery.UI.All 1.8.9'. Successfully added 'jQuery 1.4.4' to MvcApplication1. Successfully added 'jQuery.UI.Core 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Core.Widget 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Core.Mouse 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Core.Position 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Core.All 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Interactions.Draggable 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Interactions.Droppable 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Interactions.Resizable 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Interactions.Selectable 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Interactions.Sortable 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Interactions.All 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Widgets.Accordion 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Widgets.Autocomplete 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Widgets.Button 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Widgets.Dialog 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Widgets.Slider 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Widgets.Tabs 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Widgets.Datepicker 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Widgets.Progressbar 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Widgets.All 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Effects.Core 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Effects.Blind 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Effects.Bounce 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Effects.Clip 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Effects.Drop 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Effects.Explode 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Effects.Fade 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Effects.Highlight 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Effects.Pulsate 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Effects.Scale 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Effects.Shake 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Effects.Slide 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Effects.Transfer 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Effects.All 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.Themes.base 1.8.9' to MvcApplication1. Successfully added 'jQuery.UI.All 1.8.9' to MvcApplication1.

look at that dependencies, after the painful wait due to my poor internet connection, i found out that i just need the jquery.ui.core package Sad smile

And i got all this packages installed

PM> Get-Package Id Version Description/Release Notes -- ------- ------------------------- jQuery 1.4.4 jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development jQuery.UI.All 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Core 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Core.All 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Core.Mouse 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Core.Position 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Core.Widget 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Effects.All 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Effects.Blind 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Effects.Bounce 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Effects.Clip 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Effects.Core 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Effects.Drop 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Effects.Explode 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Effects.Fade 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Effects.Highlight 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Effects.Pulsate 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Effects.Scale 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Effects.Shake 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Effects.Slide 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Effects.Transfer 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Interactions.All 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Interactions.Drag... 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Interactions.Drop... 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Interactions.Resi... 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Interactions.Sele... 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Interactions.Sort... 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Themes.base 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Widgets.Accordion 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Widgets.All 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Widgets.Autocomplete 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Widgets.Button 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Widgets.Datepicker 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Widgets.Dialog 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Widgets.Progressbar 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Widgets.Slider 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ... jQuery.UI.Widgets.Tabs 1.8.9 jQuery UI is an open source library of interface components — interactions, full-featured widgets, and animation effects — based on the stellar jQuery javascript library . Each component is built according ...

 

now, instead of running uninstall-package to each of dependencies

we could instead run

PM> Uninstall-Package jquery.ui.all -RemoveDependencies Successfully removed 'jQuery.UI.All 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Themes.base 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Effects.All 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Effects.Transfer 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Effects.Slide 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Effects.Shake 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Effects.Scale 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Effects.Pulsate 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Effects.Highlight 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Effects.Fade 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Effects.Explode 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Effects.Drop 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Effects.Clip 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Effects.Bounce 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Effects.Blind 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Effects.Core 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Widgets.All 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Widgets.Progressbar 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Widgets.Datepicker 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Widgets.Tabs 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Widgets.Slider 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Widgets.Dialog 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Widgets.Button 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Widgets.Autocomplete 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Widgets.Accordion 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Interactions.All 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Interactions.Sortable 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Interactions.Selectable 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Interactions.Resizable 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Interactions.Droppable 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Interactions.Draggable 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Core.All 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Core.Position 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Core.Mouse 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Core.Widget 1.8.9' from MvcApplication1. Successfully removed 'jQuery.UI.Core 1.8.9' from MvcApplication1. Successfully removed 'jQuery 1.4.4' from MvcApplication1. Successfully uninstalled 'jQuery.UI.All 1.8.9'. Successfully uninstalled 'jQuery.UI.Themes.base 1.8.9'. Successfully uninstalled 'jQuery.UI.Effects.All 1.8.9'. Successfully uninstalled 'jQuery.UI.Effects.Transfer 1.8.9'. Successfully uninstalled 'jQuery.UI.Effects.Slide 1.8.9'. Successfully uninstalled 'jQuery.UI.Effects.Shake 1.8.9'. Successfully uninstalled 'jQuery.UI.Effects.Scale 1.8.9'. Successfully uninstalled 'jQuery.UI.Effects.Pulsate 1.8.9'. Successfully uninstalled 'jQuery.UI.Effects.Highlight 1.8.9'. Successfully uninstalled 'jQuery.UI.Effects.Fade 1.8.9'. Successfully uninstalled 'jQuery.UI.Effects.Explode 1.8.9'. Successfully uninstalled 'jQuery.UI.Effects.Drop 1.8.9'. Successfully uninstalled 'jQuery.UI.Effects.Clip 1.8.9'. Successfully uninstalled 'jQuery.UI.Effects.Bounce 1.8.9'. Successfully uninstalled 'jQuery.UI.Effects.Blind 1.8.9'. Successfully uninstalled 'jQuery.UI.Effects.Core 1.8.9'. Successfully uninstalled 'jQuery.UI.Widgets.All 1.8.9'. Successfully uninstalled 'jQuery.UI.Widgets.Progressbar 1.8.9'. Successfully uninstalled 'jQuery.UI.Widgets.Datepicker 1.8.9'. Successfully uninstalled 'jQuery.UI.Widgets.Tabs 1.8.9'. Successfully uninstalled 'jQuery.UI.Widgets.Slider 1.8.9'. Successfully uninstalled 'jQuery.UI.Widgets.Dialog 1.8.9'. Successfully uninstalled 'jQuery.UI.Widgets.Button 1.8.9'. Successfully uninstalled 'jQuery.UI.Widgets.Autocomplete 1.8.9'. Successfully uninstalled 'jQuery.UI.Widgets.Accordion 1.8.9'. Successfully uninstalled 'jQuery.UI.Interactions.All 1.8.9'. Successfully uninstalled 'jQuery.UI.Interactions.Sortable 1.8.9'. Successfully uninstalled 'jQuery.UI.Interactions.Selectable 1.8.9'. Successfully uninstalled 'jQuery.UI.Interactions.Resizable 1.8.9'. Successfully uninstalled 'jQuery.UI.Interactions.Droppable 1.8.9'. Successfully uninstalled 'jQuery.UI.Interactions.Draggable 1.8.9'. Successfully uninstalled 'jQuery.UI.Core.All 1.8.9'. Successfully uninstalled 'jQuery.UI.Core.Position 1.8.9'. Successfully uninstalled 'jQuery.UI.Core.Mouse 1.8.9'. Successfully uninstalled 'jQuery.UI.Core.Widget 1.8.9'. Successfully uninstalled 'jQuery.UI.Core 1.8.9'. Successfully uninstalled 'jQuery 1.4.4'.

and that nice command take care it all

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s