package_state_windows
This method manage packages using Chocolatey.
⚙️ Compatible targets: Windows
Parameters
| Name | Documentation |
|---|---|
| PackageName | Software name to install. This parameter is required. |
| Status | 'present' or 'absent', defaults to 'present'. Choices:
This parameter is optional. |
| Provider | default to choco. Choices:
This parameter is optional. |
| Params | params to pass to the package installation. This parameter is optional. |
| Version | version, default to 'latest'. This parameter is optional. |
| Source | repository source URL. This parameter is optional. |
| ProviderParams | parameters to pass to the underlying choco command. This parameter is optional. |
| AutoUpgrade | autoUpgrade, default to false. Choices:
This parameter is optional. |
Outcome conditions
You need to replace ${PackageName} with its actual canonified value.
- ✅ Ok:
package_state_windows_${PackageName}_ok- ☑️ Already compliant:
package_state_windows_${PackageName}_kept - 🟨 Repaired:
package_state_windows_${PackageName}_repaired
- ☑️ Already compliant:
- ❌ Error:
package_state_windows_${PackageName}_error
Example
method: package_state_windows
params:
PackageName: VALUE
Source: OPTIONAL_VALUE
Params: OPTIONAL_VALUE
Provider: choco
AutoUpgrade: 'true'
ProviderParams: OPTIONAL_VALUE
Version: OPTIONAL_VALUE
Status: present
Documentation
Install a windows package using Chocolatey. This method assume the following third party tools are already installed on the target node:
chocolatey cli: https://chocolatey.org/install- the
cChocoDSC resource! https://github.com/chocolatey/cChoco
Please note that the cChoco DSC resource is no longer maintained by Chocolatey.
Parameters
Required args:
PackageNameName of target packageStatuscan be "present" or "absent"
Optional args:
Source: Chocolatey repository URL to retrieve the package fromAutoUpgradedefault set to falseParams: Package parameters, passed to the installerVersion: 'latest' or any exact specific version numberProviderParams: CLI options to pass to the underlying choco CLI usedProvider: Provider used to installed the package (always 'choco')