# sycnex/windows10debloater architecture

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

- Interactive diagram: https://gitdiagram.com/sycnex/windows10debloater
- Repository: https://github.com/sycnex/windows10debloater

## Overview

##### Project type and purpose
- This is an open-source PowerShell utility suite for “debloating” Windows 10.
- It offers three main user-facing interfaces:
- Interactive CLI (`Windows10Debloater.ps1`)
- GUI application (`Windows10DebloaterGUI.ps1`)
- Silent/Sysprep version with switches (`Windows10SysPrepDebloater.ps1`)
- Under the hood it orchestrates dozens of smaller scripts (the “Individual Scripts” folder) to remove preinstalled apps, tweak registry keys, disable tasks, etc.

##### Main components
a. User Interfaces
- PowerShell Console (Interactive CLI)
- PowerShell GUI Host (WinForms/WPF wrapper in the GUI script)
- Deployment Automation (silent SysPrep script with parameters)
b. Core Engine & Modules
- Core entrypoint scripts (`Windows10Debloater*.ps1`)
- Individual command modules (each `.ps1` in “Individual Scripts”)
c. System APIs & Subsystems
- AppX Package Manager (Remove-AppxPackage, Remove-AppxProvisionedPackage)
- Windows Registry (Get/Set-ItemProperty for privacy keys)
- Task Scheduler (Disable-ScheduledTask)
d. External Services (minimal)
- Windows Update/Telemetry endpoints (indirectly through registry)
- Microsoft Store sources (for reinstall/revert operations)

##### Relationships and data flow
- User selects a script/interface → calls Core entrypoint → parses switches/prompts → invokes specific Individual Scripts modules → each module calls one or more OS subsystems (AppX, Registry, Scheduled Tasks) → returns status back up to UI.
- The silent SysPrep script is invoked by MDT or other deployment tools to run automatically without user interaction.

##### Architectural patterns & design principles
- Modular design: each “Individual Script” encapsulates one debloat or revert function.
- Layered separation:
- Presentation (CLI/GUI)
- Orchestration (entrypoint scripts)
- Domain modules (Individual Scripts)
- Infrastructure (OS APIs)
- Use of idempotent operations and switch parameters for repeatable automation.

##### Detailing components
- “Windows10DebloaterGUI.ps1” and “Windows10Debloater.ps1” as two separate UI blocks.
- “Windows10SysPrepDebloater.ps1” as an automation block with switch parameters (`-SysPrep`, `-Debloat`, `-Privacy`).
- “Individual Scripts” folder as a module library: list a few representative modules (e.g., Debloat, Remove-Keys, Protect-Privacy, Stop-EdgePDF, Revert-Changes).
- OS Subsystems cluster:
- AppX Package Manager
- Registry Hive (HKLM:\…, HKCU:\…)
- Task Scheduler Service

- Clear component labels (script names, module functions, OS subsystems)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Users
    User((User)):::user

    %% Presentation Layer
    subgraph "Presentation Layer" 
        CLI[/"PowerShell Console\n(Interactive CLI)"/]:::ui
        GUI[/"PowerShell GUI Host\n(GUI Application)"/]:::ui
        SysPrep[/"Silent/Sysprep Automation\n(switch-based)"/]:::ui
    end

    %% Orchestration Layer
    subgraph "Orchestration Layer"
        Orchestrator["Core Entrypoint\nWindows10Debloater*.ps1"]:::orchestration
        Decision{"Mode?\n-SysPrep\n-Debloat\n-Privacy"}:::orchestration
    end

    %% Domain Modules
    subgraph "Individual Scripts" 
        DebloatGroup["Debloat Windows\n(folder)"]:::modules
        DisableCortana["Disable Cortana"]:::modules
        EnableCortana["Enable Cortana"]:::modules
        ProtectPrivacy["Protect Privacy"]:::modules
        RemoveRegKeys["Remove Bloatware RegKeys"]:::modules
        StopEdgePDF["Stop Edge PDF"]:::modules
        EnableEdgePDF["Enable Edge PDF"]:::modules
        RevertChanges["Revert Changes"]:::modules
        UninstallOneDrive["Uninstall OneDrive"]:::modules
        FixWhitelisted["Fix Whitelisted Apps"]:::modules
        ClearLastUsed["Clear Last Used Files\nand Folders"]:::modules
        DisableLastView["Disable Last Used Files\nand Folders View"]:::modules
        SetLaunchToComp["Set Explorer’s LaunchTo Computer"]:::modules
        UnpinStart["Unpin Start"]:::modules
    end

    %% OS Subsystems
    subgraph "OS Subsystems"
        AppX([AppX Package Manager]):::subsys
        Registry[(Windows Registry)]:::subsys
        TaskSched([Task Scheduler Service]):::subsys
    end

    %% Flows
    User -->|select interface| CLI
    User -->|select interface| GUI
    User -->|invoke automation| SysPrep

    CLI -->|Invoke-Function| Orchestrator
    GUI -->|Invoke-Function| Orchestrator
    SysPrep -->|Parse-Switches| Decision
    Decision -->|Debloat Modules| DebloatGroup
    Decision -->|Revert Modules| RevertChanges

    Orchestrator -->|Invoke-Script| DebloatGroup
    Orchestrator -->|Invoke-Script| DisableCortana
    Orchestrator -->|Invoke-Script| EnableCortana
    Orchestrator -->|Invoke-Script| ProtectPrivacy
    Orchestrator -->|Invoke-Script| RemoveRegKeys
    Orchestrator -->|Invoke-Script| StopEdgePDF
    Orchestrator -->|Invoke-Script| EnableEdgePDF
    Orchestrator -->|Invoke-Script| RevertChanges
    Orchestrator -->|Invoke-Script| UninstallOneDrive
    Orchestrator -->|Invoke-Script| FixWhitelisted
    Orchestrator -->|Invoke-Script| ClearLastUsed
    Orchestrator -->|Invoke-Script| DisableLastView
    Orchestrator -->|Invoke-Script| SetLaunchToComp
    Orchestrator -->|Invoke-Script| UnpinStart

    %% Modules to Subsystems
    DebloatGroup -->|Remove-AppxPackage| AppX
    DisableCortana -->|Remove-AppxPackage| AppX
    EnableCortana -->|Add-AppxPackage| AppX
    ProtectPrivacy -->|Set-ItemProperty| Registry
    RemoveRegKeys -->|Remove-ItemProperty| Registry
    StopEdgePDF -->|Disable-ScheduledTask| TaskSched
    EnableEdgePDF -->|Enable-ScheduledTask| TaskSched
    UninstallOneDrive -->|Remove-AppxPackage| AppX
    FixWhitelisted -->|Invoke-Whitelisted| AppX
    ClearLastUsed -->|Set-ItemProperty| Registry
    DisableLastView -->|Set-ItemProperty| Registry
    SetLaunchToComp -->|Set-ItemProperty| Registry
    UnpinStart -->|Remove-StartPin| TaskSched

    %% Click events
    click CLI "https://github.com/sycnex/windows10debloater/blob/master/Windows10Debloater.ps1"
    click GUI "https://github.com/sycnex/windows10debloater/blob/master/Windows10DebloaterGUI.ps1"
    click SysPrep "https://github.com/sycnex/windows10debloater/blob/master/Windows10SysPrepDebloater.ps1"
    click Orchestrator "https://github.com/sycnex/windows10debloater/tree/master/Individual Scripts/"
    click DebloatGroup "https://github.com/sycnex/windows10debloater/tree/master/Individual Scripts/Debloat Windows/"
    click DisableCortana "https://github.com/sycnex/windows10debloater/blob/master/Individual Scripts/Disable Cortana.ps1"
    click EnableCortana "https://github.com/sycnex/windows10debloater/blob/master/Individual Scripts/Enable Cortana.ps1"
    click ProtectPrivacy "https://github.com/sycnex/windows10debloater/blob/master/Individual Scripts/Protect Privacy.ps1"
    click RemoveRegKeys "https://github.com/sycnex/windows10debloater/blob/master/Individual Scripts/Remove Bloatware RegKeys.ps1"
    click StopEdgePDF "https://github.com/sycnex/windows10debloater/blob/master/Individual Scripts/Stop Edge PDF.ps1"
    click EnableEdgePDF "https://github.com/sycnex/windows10debloater/blob/master/Individual Scripts/Enable Edge PDF.ps1"
    click RevertChanges "https://github.com/sycnex/windows10debloater/blob/master/Individual Scripts/Revert Changes.ps1"
    click UninstallOneDrive "https://github.com/sycnex/windows10debloater/blob/master/Individual Scripts/Uninstall OneDrive.ps1"
    click FixWhitelisted "https://github.com/sycnex/windows10debloater/blob/master/Individual Scripts/Fix Whitelisted Apps.ps1"
    click ClearLastUsed "https://github.com/sycnex/windows10debloater/blob/master/Individual Scripts/Clear Last Used Files and Folders.ps1"
    click DisableLastView "https://github.com/sycnex/windows10debloater/blob/master/Individual Scripts/Disable Last Used Files and Folders View.ps1"
    click SetLaunchToComp "https://github.com/sycnex/windows10debloater/blob/master/Individual Scripts/Set Explorers LaunchTo Computer.ps1"
    click UnpinStart "https://github.com/sycnex/windows10debloater/blob/master/Individual Scripts/Unpin Start.ps1"

    %% Styles
    classDef user fill:#ffffff,stroke:#000,stroke-width:1px;
    classDef ui fill:#cce5ff,stroke:#0366d6,stroke-width:1px;
    classDef orchestration fill:#d4edda,stroke:#2e7d32,stroke-width:1px;
    classDef modules fill:#fff3cd,stroke:#ff8c00,stroke-width:1px;
    classDef subsys fill:#e2e3e5,stroke:#6c757d,stroke-width:1px;
```
