Skip to main content
The configure test command tests a configuration file against the current system state without making any changes.

Syntax

winget configure test [<file>] [options]

Arguments

file
path
Path to YAML configuration file or URL

Options

-f, --file
path
Configuration file path or URL (alternative to positional argument)
-h, --history
string
Test configuration from history by ID
--module-path
path
Path to PowerShell modules directory
--processor-path
path
Path to custom DSC processor
--suppress-initial-details
flag
Skip displaying configuration details before testing
--accept-configuration-agreements
flag
Accept configuration agreements without prompting

Examples

Test configuration file:
winget configure test development-setup.yaml
Test from URL:
winget configure test https://example.com/config.yaml
Test without prompts:
winget configure test setup.yaml --accept-configuration-agreements
Test from history:
winget configure test --history abc123

Output Format

Shows test results for each resource:
Testing configuration: development-setup.yaml

Resources:
  [1] Microsoft.WinGet.DSC/WinGetPackage
      Description: Install Visual Studio Code
      Current State: Not Installed
      Desired State: Installed
      Result: Not in Desired State
  
  [2] PSDscResources/Registry
      Description: Set system preference
      Current State: HKLM:\Software\MyApp\Setting = Disabled
      Desired State: HKLM:\Software\MyApp\Setting = Enabled
      Result: Not in Desired State
  
  [3] Microsoft.WinGet.DSC/WinGetPackage
      Description: Install Git
      Current State: Installed (2.40.0)
      Desired State: Installed
      Result: In Desired State

Summary:
  Total: 3
  In Desired State: 1
  Not in Desired State: 2

Test Results

Each resource shows:
  • Current State - Actual system state
  • Desired State - Target state from configuration
  • Result - Whether they match

Use Cases

Dry Run

Check what changes would be made:
winget configure test setup.yaml

Validate Configuration

Ensure configuration is working as expected:
winget configure test setup.yaml

Configuration Drift Detection

Check if system has drifted from previous configuration:
winget configure test --history abc123

Exit Codes

  • 0 - All resources in desired state
  • 0x8A150033 - Some resources not in desired state
  • 0x8A150031 - Configuration file not found
  • 0x8A150032 - Configuration parsing failed
The test command never modifies the system. It only checks current state against desired state.

Build docs developers (and LLMs) love