$currentPath = [Environment]::GetEnvironmentVariable("Path", "Machine") if ($currentPath -notlike " $InstallPath ") $newPath = "$currentPath;$InstallPath" [Environment]::SetEnvironmentVariable("Path", $newPath, "Machine") Write-Host "Added $InstallPath to system PATH" -ForegroundColor Green
Follow these steps to complete the installation on your offline computer: nuget 2.8.5.201 powershell download offline
# OfflineInstall-NuGet.ps1 $expectedHash = "SHA512_OF_PRE_DOWNLOADED_FILE" $sourceMedia = "D:\offline-packages\nuget-2.8.5.201.exe" $targetPath = "$env:USERPROFILE\.nuget\nuget.exe" $currentPath = [Environment]::GetEnvironmentVariable("Path"
Save the following script as Install-NuGetOffline.ps1 . Run it on your offline machine after copying the required binary. nuget 2.8.5.201 powershell download offline
The request for an offline download indicates a hostile or restricted network environment. Common scenarios include: