|
| 1 | +# Copilot Instructions for Winget-AutoUpdate |
| 2 | + |
| 3 | +## Project Overview |
| 4 | +- **Winget-AutoUpdate (WAU)** automates daily updates of Windows applications using the `winget` tool, supporting both system and user contexts. |
| 5 | +- The project is PowerShell-centric, with core scripts in `Sources/Winget-AutoUpdate/` and modular functions in `functions/`. |
| 6 | +- GPO/Intune management is supported via ADMX/ADML templates in `Sources/Policies/ADMX/`. |
| 7 | +- Customization is enabled through "Mods" scripts in `Sources/Winget-AutoUpdate/mods/`. |
| 8 | + |
| 9 | +## Key Components |
| 10 | +- **Main scripts:** |
| 11 | + - `Winget-Upgrade.ps1`: Main update logic, loads all functions from `functions/`. |
| 12 | + - `Winget-Install.ps1`: Used for deployment scenarios (Intune/SCCM). |
| 13 | + - `WAU-Notify.ps1`, `WAU-Policies.ps1`: Notification and policy handling. |
| 14 | +- **Functions:** Each PowerShell file in `functions/` implements a single responsibility (e.g., `Get-ExcludedApps.ps1`, `Update-App.ps1`). |
| 15 | +- **Mods:** |
| 16 | + - Place custom scripts in `mods/` to hook into app install/upgrade events (see `mods/README.md`). |
| 17 | + - Supported hooks: `-preinstall`, `-upgrade`, `-install`, `-installed`, `-notinstalled`. |
| 18 | + - Global mods: `_WAU-mods.ps1`, `_WAU-mods-postsys.ps1`, `_WAU-notinstalled.ps1`. |
| 19 | +- **GPO/Intune:** |
| 20 | + - ADMX/ADML files in `Sources/Policies/ADMX/` allow central management of WAU settings. |
| 21 | + - Since v1.16.5, GPO Black/White lists are auto-detected—no need to set `-ListPath GPO`. |
| 22 | + |
| 23 | +## Developer Workflows |
| 24 | +- **No build step**: Scripts are run directly via PowerShell. |
| 25 | +- **Testing:** |
| 26 | + - No formal test suite; test by running scripts with various parameters and checking logs in `logs/`. |
| 27 | +- **Debugging:** |
| 28 | + - Logs are written to `logs/updates.log` (system context). |
| 29 | + - Use `Write-ToLog` for custom debug output. |
| 30 | +- **Deployment:** |
| 31 | + - MSI installer is built using Wix (see `Wix/`). |
| 32 | + - Deploy via Intune/SCCM by installing the MSI package (WAU.msi). |
| 33 | + |
| 34 | +## Project Conventions |
| 35 | +- **All functions are dot-sourced at runtime from the `functions/` directory.** |
| 36 | +- **Mods**: Use the provided templates in `mods/` for custom logic. Scripts are matched by naming convention. |
| 37 | +- **GPO/Intune**: Only the `en-US` ADML file is supported. |
| 38 | +- **Lists**: `excluded_apps.txt` and `included_apps.txt` are used unless a GPO list is present (GPO always takes precedence). |
| 39 | +- **Wildcard support**: App lists support `*` wildcards (e.g., `Mozilla.Firefox*`). |
| 40 | + |
| 41 | +## Integration Points |
| 42 | +- **winget**: All app management is via the Windows Package Manager CLI. |
| 43 | +- **GPO/Intune**: Settings are read from registry or policy files if present. |
| 44 | +- **Wix**: Used for MSI packaging (see `Wix/build.wxs`). |
| 45 | + |
| 46 | +## Examples |
| 47 | +- To add a global mod: copy `_WAU-mods-template.ps1` to `_WAU-mods.ps1` and customize. |
| 48 | +- To exclude an app: add its ID to `excluded_apps.txt` or configure via GPO. |
| 49 | +- To deploy via Intune: use `Winget-Install.ps1` with appropriate parameters. |
| 50 | + |
| 51 | +For more, see `README.md`, `Sources/Policies/README.md`, and `Sources/Winget-AutoUpdate/mods/README.md`. |
0 commit comments