我正在尝试使用以下命令安装NuGet包提供程序。
我想在脚本中完成这个安装。我该如何跳过确认提示?
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
我还尝试添加-Confirm:$false
标志,但仍会提示确认。
例如,
NuGet provider is required to continue
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\Booker\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"):
我想在脚本中完成这个安装。我该如何跳过确认提示?
Install-PackageProvider NuGet ...
,你仍然无法看到包提供程序吗? 你尝试过添加Get-PackageProvider -ListAvailable -Verbose
来查看是否显示了提供程序吗? - Gonzalo Contento