Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skip confirmation while using Install-Package?

I have added ChocolateyGet as a provider on Powershell so I can use it with PackageManagement (OneGet), it works but every package I try to install warns:

https://www.chocolatey.org is not a trusted package source

Then asks for confirmation. It also asks me if I agree to the license of the package.

I wanted to make a script to automatically install some packages, but I needed this script to be unattended, and it's not possible now because it asks those two previous questions.

Is there anyway to circumvent/automatically respond these confirmations? Like the y or yes command on Linux?

like image 369
guilherme.oc97 Avatar asked Apr 23 '17 01:04

guilherme.oc97


1 Answers

You need to use -Force where there is a Force property available on any cmdlets, otherwise if there isn't but there is a confirm, you are able to use -Confirm:$False which acts the same as pressing Yes.

Be careful using this however as if you in fact didn't want to process the action...you don't get a second chance.

like image 187
Random206 Avatar answered Oct 04 '22 17:10

Random206