Search code examples
chocolatey

Chocolatey parameters for dependent packages


Do the '--params' passed to 'choco install' command are accessible/available to 'dependent' packages? My package 'B' has a dependency on package 'A', when package 'A' is being installed I want to access the parameters (--params) passed to package 'B'. My tests show that accessing the parameters during package 'A' install using 'Get-PackageParameters' or '$env:ChocolateyPackageParameters' returns nothing (if package 'A' is being installed as part of dependency).


Solution

  • By default any --params parameters are passed to the .install / .portable version of the same package name.

    The parameter you are looking for is --paramsglobal which passes parameters to all dependent packages. For completeness there is also an --argsglobal parameter which does the same but for installers inside dependent packages.

    --paramsglobal is what you are looking for.