Using NuGet with Powershell 5.0

I had a project requir­ing the Newtonsoft.Json libraries (NuGet - GitHub). I also want­ed to play around a bit with OneGet as I hadn’t had a need to yet.

Pow­er­shell 5 (5.0.9926.2 as of this writ­ing) makes this easy. Here’s about all that’s need­ed to get this run­ning and access the entire NuGet.org pack­age repos­i­to­ry.

Register-PackageSource -Name NuGet -ProviderName Chocolatey -Location https://nuget.org/api/v2/
Get-PackageProvider -Name NuGet -ForceBootstrap
Find-Package -ProviderName NuGet -Name Newtonsoft.Json | Install-Package