Skip to content

Latest commit

 

History

History
174 lines (139 loc) · 4.58 KB

ChocolateyPackages3rd.adoc

File metadata and controls

174 lines (139 loc) · 4.58 KB

DSC Resource 'ChocolateyPackages3rd'

ChocolateyPackages3rd is aimed to install additional packages using Chocolatey.

Now you can configure additional configuration steps between installation of two Chocolatey packages in the YAML configuration.

Important

This DSC resource can only be used if the required parent configuration ChocolateyPackages is defined and activated in the YAML files.

In the Configuration section ChocolateyPackages must be placed before ChocolateyPackages3rd.

Source

DSC Resource

Documentation

Table 1. Attributes of DSC Resource 'ChocolateyPackages3rd'
Parameter Attribute DataType Description Allowed Values

ForceRebootBefore

Boolean

Force reboot before installation of first Chocolatey package.

Only one reboot after first start of a DSC configuration is supported.
To re-enable the system reboot feature the registry key value RebootBefore_ChocolateyPackages3rd at HKLM:\SOFTWARE\DSC Community\CommonTasks\RebootRequests must be deleted.

  • False (default)

  • True

Packages

Hashtable[]

List of Chocolatey packages

Table 2. Attributes of DSC Resource 'ChocolateyPackages3rd/Packages'
Parameter Attribute DataType Description Allowed Values

Name

Key

String

Chocolatey Package Id

Version

String

Chocolatey Package Version

  • '' → Install latest version if package is not installed

  • 1.0 → Install specified version if no newer version is installed

  • Latest → Install or upgrade to latest version

Ensure

String

Specifies whether the Chocolatey Package should be installed on the machine or not

  • Present (default)

  • Absent

Rank

Uint16

Rank to control the installation order of packages

A package with a lower rank is installed before a package with a higher rank. With specifing the rank you can control the installation order of packages in the MOF files. This is useful on multiple YAML layer scenarios to define the installation order independent from the YAML layer merging.

Default: 1000

ChocolateyOptions

String[] (KeyValuePair)

All option values shall be provided as strings, so enclose numerical values in ''.

UpdateOnly

Boolean

Only updates installed package and ignores packages not Installed.

  • True

  • False (default)

Credential

PSCredential

ForceReboot

Boolean

Force a reboot after first installation of the package.

Only one reboot after first start of a DSC configuration is supported.
A Reboot after upgrade of an installed package is currently not supported.
To re-enable the system reboot feature the registry key value RebootAfter_Chocolatey_<Name> at HKLM:\SOFTWARE\DSC Community\CommonTasks\RebootRequests must be deleted.

  • True

  • False (default)

Example
ChocolateyPackages3rd:
  Packages:
    - Name: notepadplusplus
      Ensure: Present
      Version: '1.0'
      ChocolateyOptions:
        PackageParameters: /FirstParam:Value1 /SecondParam:Value2
      Credential: '[ENC=PE9ianM...=]'
    - Name: winrar
      Version: Latest
      Rank: 100   # winrar is installed before notepadplusplus (with the default rank)
      ForceReboot: true
    - Name: very_large_package
      Ensure: Present
      Version: '1.0'
      ChocolateyOptions:
        ChocolateyOptions:
        TimeOut: '3600'  # 1h install timeout
Recommended Lookup Options in Datum.yml (Excerpt)
lookup_options:

  ChocolateyPackages3rd:
    merge_hash: deep
  ChocolateyPackages3rd\Packages:
    merge_hash_array: UniqueKeyValTuples
    merge_options:
      tuple_keys:
        - Name