# guylescalier/wac architecture

> Architecture diagram of the GitHub repository guylescalier/wac, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/guylescalier/wac
- Repository: https://github.com/guylescalier/wac

## Overview

##### Project type and purpose
- This is an open-source PowerShell Desired State Configuration (DSC) toolkit.
- It provides modules and helper functions to compare, test, expand and set DSC configurations via YAML files.
- It includes multiple “versions” (v2, v3) of the same core capability, Pester tests for validation, and CI workflow definitions for automated testing.

##### File structure
- Top-level folders:
– .github/workflows: CI definition (pester-ci.yaml)
– DSC: primary DSC modules and resources
– DSC/v2: version-2 modules, configuration scripts, output logs
– DSC/v3: version-3 configuration scripts and outputs
– DSC/Modules: helper modules (CompareDiff-Helpers, MyResources, Pester-ShouldBeDeep)
– DSC/resources: sample certificates, hosts file, Visual Studio settings, WinMerge config
– drafts: experimental scripts (WaC)
– package.json & PSM-NEXUS.md: packaging/publishing metadata
– README.md, PesterConfig.ps1, comparison_report.md: docs and test settings
- Key patterns:
– “Modules” directory holds reusable code, each module in its own folder with .psm1/.psd1 and tests.
– v2 and v3 directories each have “configuration” scripts that read YAML, expand configurations, then run get/set/test workflows.
– “out” subfolders capture CLI output for each cmdlet.

##### README for additional insights
- It provides:
– External references on PowerShell module conventions and automatic variables.
– Sample usage of the toolkit’s commands: Get-DscConfigurationState, Test-DscConfigurationState, Compare-DscConfigurationState, Set-DscConfigurationState.
– Prerequisites and installation steps (PSGallery modules, execution policy).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% CI/CD Pipeline
    CI["CI/CD Pipeline"]:::ci
    click CI "https://github.com/guylescalier/wac/blob/main/.github/workflows/pester-ci.yaml"

    %% Packaging & Publishing
    PKG["Packaging & Publishing"]:::packaging
    PKG1["package.json"]:::packaging
    PKG2["PSM-NEXUS.md"]:::packaging

    %% External Dependencies
    subgraph "External Dependencies"
        YAML["powershell-yaml"]:::external
        PSDsc["PSDscResources"]:::external
        DSCsvc["PSDesiredStateConfiguration"]:::external
        VSDSC["Microsoft.VisualStudio.DSC"]:::external
        WinGet["Microsoft.WinGet.DSC"]:::external
    end

    %% CLI Entry Points
    subgraph "CLI Entry Points"
        Install["install-dsc.ps1"]:::script
        ExpandCLI["Expand-Configuration.ps1"]:::script
    end
    click Install "https://github.com/guylescalier/wac/blob/main/DSC/install-dsc.ps1"
    click ExpandCLI "https://github.com/guylescalier/wac/blob/main/DSC/v2/configuration/Expand-Configuration.ps1"
    click ExpandCLI "https://github.com/guylescalier/wac/blob/main/DSC/v3/configuration/Expand-Configuration.ps1"

    %% Configuration Artifacts
    subgraph "Configuration Artifacts"
        Resources["DSC/resources"]:::config
        V2_YAML["v2/configuration/*.yaml"]:::config
        V3_YAML["v3/configuration/*.yaml"]:::config
        V2_Out["v2/out/*.out"]:::config
        V3_Out["v3/out/*.out"]:::config
    end
    click Resources "https://github.com/guylescalier/wac/tree/main/DSC/resources/"

    %% Core Modules
    subgraph "Core Modules"
        Compare["CompareDiff-Helpers"]:::code
        MyRes["MyResources"]:::code
        ShouldDeep["Pester-ShouldBeDeep"]:::code
    end
    click Compare "https://github.com/guylescalier/wac/blob/main/DSC/Modules/CompareDiff-Helpers/CompareDiff-Helpers.psm1"
    click MyRes "https://github.com/guylescalier/wac/tree/main/DSC/Modules/MyResources/"
    click ShouldDeep "https://github.com/guylescalier/wac/blob/main/DSC/Modules/Pester-ShouldBeDeep/Pester-ShouldBeDeep.psm1"

    %% Versioned Engine v2
    subgraph "Versioned Engine v2"
        subgraph ModulesV2
            DSCv2_ConfState["MyDscConfigurationState"]:::code
            DSCv2_ResState["MyDscResourceState"]:::code
        end
        subgraph ConfigV2
            V2_ConfigScript["Expand-Configuration.ps1"]:::script
            V2_YAMLFiles["configuration.dsc.yaml / expanded-configuration.dsc.yaml / test-configuration.dsc.yaml"]:::config
        end
        V2_Out
    end
    click DSCv2_ConfState "https://github.com/guylescalier/wac/blob/main/DSC/v2/Modules/MyDscConfigurationState/MyDscConfigurationState.psm1"
    click DSCv2_ResState "https://github.com/guylescalier/wac/blob/main/DSC/v2/Modules/MyDscResourceState/MyDscResourceState.psm1"
    click V2_ConfigScript "https://github.com/guylescalier/wac/blob/main/DSC/v2/configuration/Expand-Configuration.ps1"

    %% Versioned Engine v3
    subgraph "Versioned Engine v3"
        subgraph ConfigV3
            V3_ConfigScript["Expand-Configuration.ps1"]:::script
            V3_TestScript["Expand-Configuration.Test.ps1"]:::test
            V3_YAMLFiles["ressources_packed.yaml / ressources_expanded.yaml"]:::config
        end
        V3_Out
    end
    click V3_ConfigScript "https://github.com/guylescalier/wac/blob/main/DSC/v3/configuration/Expand-Configuration.ps1"
    click V3_TestScript "https://github.com/guylescalier/wac/blob/main/DSC/v3/configuration/Expand-Configuration.Test.ps1"

    %% Testing Layer
    subgraph "Testing Layer (Pester)"
        Tests1["CompareDiff-Helpers Tests"]:::test
        Tests2["MyResources Tests"]:::test
        Tests3["v2 Engine Tests"]:::test
        Tests4["v3 Engine Test"]:::test
    end

    %% Relationships
    Install -->|"invokes"| ExpandCLI
    ExpandCLI -->|"reads YAML"| V2_YAML
    ExpandCLI -->|"reads YAML"| V3_YAML
    V2_YAML --> DSCv2_ConfState
    V2_YAML --> DSCv2_ResState
    V3_YAML --> V3_ConfigScript
    DSCv2_ConfState --> Compare
    DSCv2_ResState --> MyRes
    V3_ConfigScript --> MyRes
    DSCv2_ConfState --> DSCsvc
    DSCv2_ResState --> DSCsvc
    V3_ConfigScript --> DSCsvc
    DSCsvc --> V2_Out
    DSCsvc --> V3_Out

    %% Tests
    Compare --> Tests1
    MyRes --> Tests2
    DSCv2_ConfState --> Tests3
    DSCv2_ResState --> Tests3
    V3_TestScript --> Tests4

    %% CI/CD
    CI --> Tests1
    CI --> Tests2
    CI --> Tests3
    CI --> Tests4
    CI --> PKG

    %% Packaging
    PKG --> PKG1
    PKG --> PKG2

    %% External Dependencies usage
    ExpandCLI --> YAML
    DSCv2_ConfState --> PSDsc
    DSCv2_ResState --> PSDsc
    V3_ConfigScript --> YAML
    MyRes --> DSCsvc
    Compare --> DSCsvc

    %% Styles
    classDef code fill:#cce5ff,stroke:#4d88ff;
    classDef config fill:#d4edda,stroke:#3c763d;
    classDef script fill:#ffe5cc,stroke:#ff8c1a;
    classDef test fill:#f2dfff,stroke:#a64ca6;
    classDef ci fill:#f8d7da,stroke:#d9534f;
    classDef packaging fill:#e2e3e5,stroke:#6c757d;
    classDef external fill:#f0f0f0,stroke:#888888;
    classDef DSCsvc fill:#ffffff,stroke:#000000,stroke-dasharray: 5 5;
```
