NuGet: test if a package is installed
With Get-Package you can get the list of currently installed packages. How can you test if a package is installed?
Get-Package returns list of packages as follows:
Id Version Description -- ------- ----------- EntityFramework 4.1.10331.0 DbContext API and Code First workflow for ADO.NET Entity Framework. MacawSolutionsFactory-Core 1.0.0 Macaw Solutions Factory Base package MacawSolutionsFactory-Spf2010 1.0.0 Macaw Solutions Factory core package for Spf2010 T4Scaffolding 1.0.0 A fast and customizable way to build parts of your .NET application via templates
To test if a package is installed do the following:
(get-package | Select-Object -ExpandProperty ID) -contains 'EntityFramework'
This will return $true or $false.