I am trying to install NuGet on an offline work machine running Windows Server 2016. Files can be uploaded to this machine via NAS. All online machines have restricted admin rights while the offline machine has full admin rights. I have found installation guides for offline machines, but they all assume that the online machine has admin rights.
How to get PowerShellGet working with no Internet access [Intrepid Integration]
These references recommend that NuGet is installed on an online machine (requires admin rights) then the installed dll is copied to the offline machine. Here's what I've tried so far:
- Tried to download NuGet on the offline machine to see where it downloads the files. It searches: https://onegetcdn.azureedge.net/providers/providers.masterList.feed.swidtag
- Followed the links in the URL and downloaded PackageManagement.NuGetProvider-2.8.5.208.dll
- On a personal computer (with admin rights) I downloaded NuGet the normal way and got the dll PackageManagement.NuGetProvider.dll installed in C:\Program Files\PackageManagement\ProviderAssemblies\nuget\2.8.5.208\
- I checked the hash of both dll's and they matched.
- On the offline computer I created a C:\Program Files\PackageManagement\ProviderAssemblies\nuget\2.8.5.208 folder and placed the dll from step 2 into this folder.
- I launched PowerShell as an admin and saw that NuGet 2.8.5.208 was installed but has no DynamicOptions. Any attempt to install nupkg packages failed. Here's what the output of Get-PackageProvider looks like:
PS C:\Windows\system32> Get-PackageProvider -ListAvailable
Name Version DynamicOptions
---- ------- --------------
msi 3.0.0.0 AdditionalArguments
msu 3.0.0.0
nuget 2.8.5.208
PowerShellGet 1.0.0.1 PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, ...
Programs 3.0.0.0 IncludeWindowsInstaller, IncludeSystemComponent
Notice that there are no DynamicOptions for NuGet. It clearly didn't install properly. I repeated this process for version 2.8.5.208 and 2.8.5.205 (both failed). I suspect there's an issue with the metadata of the dll I copied to the offline machine.
How can I get NuGet to install properly on my offline machine without admin rights on the online machines?