Published on
Takes approximately 1 minute minutes to read

Package Console Powershell Cheat Sheet

Visual Studio plus Powershell

A cheat sheet of all the cool things that knowing PowerShell can help with when dealing with Visual Studio's Package Console.

Get-Package -ProjectName {From Project} | Install-Package -ProjectName {Target Project} -IgnoreDependencies

Copy packages from one project to another.

Get-Package -ProjectName {From Project} | % { Install-Package -ProjectName {Target Project} -IgnoreDependencies -Version $_.Version.ToString() $_.Id }

Same as above, but if you care about versions.

("xunit","autofixture", "nsubstitute", "fluentassertions") | %{ Install-Package $_ -DependencyVersion Highest }

Batch install packages.

Get-Project -All | Install-Package Microsoft.Net.Compilers

Install package onto all projects.

Get-Package -Updates | ?{$_.Id -ne "refit"} | Update-Package

Filter package upgrades.