我有一台不能访问 Internet 的主机,想在上面离线加载 VMware 的 PowerCLI 模块,下载好对应文件,运行 save-module 报错。
命令:
Save-Module -Name VMware.PoweCLI -Path C:\VMware-PowerCLI-12.3.0-17860403
报错:
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet
provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
'C:\Users\administrator\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider
by running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to
install and import the NuGet provider now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): n
我在下载了NuGet程序,并复制到了“C:\Program Files\PackageManagement\ProviderAssemblies” 和 “C:\Users\administrator\AppData\Local\PackageManagement\ProviderAssemblies” 目录,但还是会报这样的提示。
这个是怎么回事?