Skip to main content
The configure validate command validates a configuration file’s syntax, schema, and DSC resources without testing or applying it.

Syntax

winget configure validate <file> [options]

Required Arguments

file
path
required
Path to YAML configuration file to validate

Options

-f, --file
path
Configuration file path (alternative to positional argument)
--module-path
path
Path to PowerShell modules directory
--processor-path
path
Path to custom DSC processor

Examples

Validate configuration file:
winget configure validate development-setup.yaml
Validate with custom module path:
winget configure validate setup.yaml --module-path C:\Modules

Validation Checks

The validate command performs:
  1. Syntax Validation - YAML syntax correctness
  2. Schema Validation - Configuration structure and properties
  3. Resource Validation - DSC resource availability and parameters
  4. Semantic Validation - Logical consistency of settings

Output Format

Valid Configuration

Validating configuration: development-setup.yaml

✓ Syntax valid
✓ Schema valid
✓ All resources available
✓ All resource parameters valid

Configuration is valid.

Invalid Configuration

Validating configuration: invalid-config.yaml

✓ Syntax valid
✗ Schema validation failed

Errors:
  Line 5: Missing required property 'settings'
  Line 12: Unknown property 'invalidField'

Configuration is invalid.

Missing Resources

Validating configuration: setup.yaml

✓ Syntax valid
✓ Schema valid
✗ Resource validation failed

Errors:
  Resource 'CustomModule/CustomResource' not found
  Install required modules or check spelling

Configuration is invalid.

Use Cases

Pre-Flight Check

Validate before applying:
winget configure validate setup.yaml

Configuration Development

Check syntax while writing configurations:
winget configure validate draft-config.yaml

CI/CD Pipeline

Validate configurations in automated workflows:
winget configure validate configs/*.yaml

Common Errors

Syntax Errors

# Invalid - missing colon
properties
  configurationVersion: 0.2.0

Schema Errors

# Invalid - wrong property name
properties:
  version: 0.2.0  # Should be 'configurationVersion'

Resource Errors

# Invalid - missing required settings
- resource: Microsoft.WinGet.DSC/WinGetPackage
  directives:
    description: Install VS Code
  # Missing 'settings' with required 'id' property

Exit Codes

  • 0 - Configuration is valid
  • 0x8A150031 - Configuration file not found
  • 0x8A150032 - Syntax validation failed
  • 0x8A150033 - Schema validation failed
  • 0x8A150035 - Resource validation failed
The validate command doesn’t check if the system meets prerequisites or if resources will succeed when applied.

Build docs developers (and LLMs) love