Install NuGet via PowerShell script Install NuGet via PowerShell script powershell powershell

Install NuGet via PowerShell script


  1. Run Powershell with Admin rights
  2. Type the below PowerShell security protocol command for TLS12:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12


Here's a short PowerShell script to do what you probably expect:

$sourceNugetExe = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"$targetNugetExe = "$rootPath\nuget.exe"Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExeSet-Alias nuget $targetNugetExe -Scope Global -Verbose

Note that Invoke-WebRequest cmdlet arrived with PowerShell v3.0. This article gives the idea.


This also seems to do it.PS Example:

Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force