Skip to content

Conversation

Copy link

Copilot AI commented Dec 13, 2025

Implements a C# console application that parses JSON configuration files and programmatically applies WinGet DSC configurations for unattended software installations.

Architecture

  • Models: Strongly-typed classes for JSON deserialization (AppConfiguration, Application, InstallOptions, ConfigurationSettings)
  • Services:
    • ConfigurationValidator: Field-level validation with detailed error reporting
    • ConsoleLogger: Color-coded logging with configurable levels (Debug/Info/Warning/Error)
    • WinGetConfigurationBuilder: Generates WinGet DSC YAML from JSON with OS assertions and Developer Mode support
    • WinGetInstaller: Async process execution with real-time output streaming and error capture
  • CLI: Argument parsing, user confirmation prompts, exit code handling

Configuration Format

{
  "applications": [
    {
      "id": "Microsoft.VisualStudioCode",
      "name": "Visual Studio Code",
      "source": "winget",
      "installOptions": { "silent": true, "acceptPackageAgreements": true },
      "description": "Install Visual Studio Code"
    }
  ],
  "configuration": {
    "minOsVersion": "10.0.22631",
    "enableDeveloperMode": true,
    "logLevel": "Information"
  }
}

Usage

dotnet run                                    # Uses apps-config.json
dotnet run -- myconfig.json output.yaml       # Custom paths
dotnet publish -c Release -r win-x64 --self-contained  # Standalone executable

Generated YAML is compatible with winget configure -f <file> --accept-configuration-agreements.

Original prompt

Build a C# console application that parses a JSON file containing application identifiers and installation options, then programmatically applies a WinGet configuration to perform unattended (silent) software installations. Include basic validation, logging, and failure handling.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits December 13, 2025 00:48
Co-authored-by: leandromonaco <5598150+leandromonaco@users.noreply.github.com>
Co-authored-by: leandromonaco <5598150+leandromonaco@users.noreply.github.com>
Co-authored-by: leandromonaco <5598150+leandromonaco@users.noreply.github.com>
Copilot AI changed the title [WIP] Build C# console application for WinGet configuration Add C# console application for programmatic WinGet configuration management Dec 13, 2025
Copilot AI requested a review from leandromonaco December 13, 2025 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants