Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why do I keep getting prompted to confirm?

Tags:

powershell

I am trying to install Install-Module -Name SqlServer -confirm:$false on many servers. I am running this as Admin

however i keep getting a prompt to confirm even though I have specified -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\\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"):

I also tried -force instead, and same thing, it keep prompting me to confirm...

This will not be ideal because if i want to use a script to install the module, i will have to be there to confirm, which defeats the purpose

like image 785
Cataster Avatar asked Oct 25 '25 14:10

Cataster


1 Answers

Try this:

Install-PackageProvider NuGet -Force
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module SqlServer -Confirm:$False -Force
like image 168
mellifluous Avatar answered Oct 27 '25 06:10

mellifluous