6

I'm working on a script to automate setting up new machines to a certain specification, which includes downloading a bunch of programs and changing user preferences.

I would just set a variable for the downloads and registry edits but most of the packages downloaded are through Chocolatey which appears not to have a dry-run (what-if) mode.

Is there a way to run the script in a mode that only prints what actions would be performed, so that nothing actually gets downloaded or changed while I'm testing the program?

mklement0
  • 382,024
  • 64
  • 607
  • 775
Matt
  • 109
  • 1
  • 10

1 Answers1

7

choco has an option to "not do anything" - this ...

--noop, --whatif, --what-if
NoOp / WhatIf - Don't actually do anything.

i have not tested it, but it looks like what you want.

Lee_Dailey
  • 7,292
  • 2
  • 22
  • 26
  • You can find all the common parameters that you can use here: https://chocolatey.org/docs/commands-reference#default-options-and-switches – Gary Ewan Park Dec 10 '18 at 07:40
  • @GaryEwanPark - yep! i got the above from the same `choco -h` that your link was generated from. [*grin*] – Lee_Dailey Dec 10 '18 at 16:30