0

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.

YM_coding
  • 95
  • 8

1 Answers1

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