Skip to Content
Published on
Takes approximately 1 minute to read
Post History

Package Console Powershell Cheat Sheet

This post was archived on .

The content may be old and no longer accurate.

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.

PowerShell
code block
Skip
Get-Package -ProjectName {From Project} | Install-Package -ProjectName {Target Project} -IgnoreDependencies

Copy packages from one project to another.

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

Same as above, but if you care about versions.

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

Batch install packages.

PowerShell
code block
Skip
Get-Project -All | Install-Package Microsoft.Net.Compilers

Install package onto all projects.

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

Filter package upgrades.