简体   繁体   中英

What is the proper syntax to pass installargs to a chocolatey package through Chef's chocolatey recipe?

I'm trying to install a chocolatey package through a chef script.

I need to pass it specific arguments to install the way I want, and I'm getting lost in the multiple levels of escaping going on between ruby, powershell, and whatever else may be in the mix.

Can someone tell me what exactly I need to put in my recipe to perform the equivalent of this?

cinst VisualStudio2013Professional -InstallArguments "/Features:'WebTools Win8SDK' /ProductKey:AB1CD-EF2GH-IJ3KL-MN4OP-QR5ST"

The best way to use chocolatey with chef is by using the chocolatey cookbook .

Using the Chocolatey resource provided in the cookbook, you want to use the args attribute:

include_recipe 'chocolatey'

chocolatey 'VisualStudio2013Professional' do
  args "/Features:'WebTools Win8SDK' /ProductKey:AB1CD-EF2GH-IJ3KL-MN4OP-QR5ST"
end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM