Skip to main content
The choco module manages packages on Windows using the Chocolatey package manager.

Functions

packages

Install, remove, or update Chocolatey packages.
str | list[str]
List of packages to ensure.
bool
default:true
Whether the packages should be installed.
bool
default:false
Whether to upgrade packages without a specified version.
Package versions can be pinned like gem: <pkg>:<version>

Example


install

Install Chocolatey package manager.
This operation is not idempotent - it will always execute.
Requires Administrator permissions to install Chocolatey.

Common Use Cases

Install Chocolatey and Packages

Development Environment

Web Server Setup

Install with Specific Versions

System Utilities

Update All Packages

Chocolatey-Specific Tips

Most Chocolatey operations require Administrator privileges. Ensure pyinfra is running with elevated permissions:
List all installed Chocolatey packages:
Search the Chocolatey repository:
Add custom package sources:
Pass additional options to Chocolatey:

Important Notes

Chocolatey requires PowerShell and .NET Framework to be installed on the target Windows system.
All choco commands in pyinfra automatically include the -y flag for non-interactive installations.
For Windows Server management, consider using pyinfra @winrm connection method for remote deployments.