I would like to be able to specify the --force argument within the chocolateyinstall.ps1 file. Currently, in that file I am invoking a batch file and try to append --force in the end but unsurprisingly it does not work.
Asked
Active
Viewed 127 times
0
-
Why are you doing this? What is your end goal? – codewario Apr 01 '22 at 15:01
1 Answers
0
You can try setting $env:ChocolateyForce = 'true'
in chocolateyInstall.ps1
, but normally this variable is meant for checking that --force
was specified by the operator at the command line. It is generally used for modifying script behavior if --force
was passed.
I don't know if changing the environment variable mid-script would have an effect or not on the Install-Chocolatey*
cmdlets.

codewario
- 19,553
- 20
- 90
- 159