IIn order to execute the first time, PackageManagement requires an internet connection to download the Nuget package provider. However, if your computer does not have an internet connection and you need to use the Nuget or PowerShellGet provider, you can download them on another computer and copy them to your target computer. Use the following steps to do this:
Install-PackageProvider -Name NuGet -RequiredVersion 220.127.116.11 -Force to install the provider from a computer with an internet connection.
After the install, you can find the provider installed in or .
Place the folder, which in this case is the Nuget folder, in the corresponding location on your target computer. If your target computer is a Nano server, you need to run Install-PackageProvider from Nano Server to download the correct Nuget binaries.
Restart PowerShell to auto-load the package provider. Alternatively, run
Get-PackageProvider -ListAvailable to list all the package providers available on the computer. Then use
Import-PackageProvider -Name NuGet -RequiredVersion 18.104.22.168 to import the provider to the current Windows PowerShell session.