-
Notifications
You must be signed in to change notification settings - Fork 55
Add WindowsUpdate resource #1351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
3c5e1fa to
4541bc0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds a new DSCv3 resource for Windows Update management with support for get, set, and export operations. The resource type is Microsoft.Windows/UpdateList and uses Windows Update Agent COM APIs to query and manage updates.
Changes:
- Added WindowsUpdate resource written in Rust with full implementation of get, set, and export operations
- Added comprehensive test coverage across multiple test files covering schema validation, executable behavior, and all three operations
- Updated build configuration files (Cargo.toml, build.data.json) to include the new resource
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| windowsupdate.dsc.resource.json | Resource manifest defining the schema and operations for Windows Update management |
| src/main.rs | Entry point handling CLI arguments and routing to appropriate operation handlers |
| src/windows_update/types.rs | Type definitions for UpdateInfo, UpdateList, and helper functions for COM interop |
| src/windows_update/get.rs | Get operation implementation with exact match filtering and AND logic |
| src/windows_update/set.rs | Set operation implementation for installing updates with validation |
| src/windows_update/export.rs | Export operation implementation with wildcard support and OR logic between filters |
| src/windows_update/mod.rs | Module structure exposing the three operation handlers |
| tests/*.tests.ps1 | Comprehensive test suites covering schema, executable, and all operations |
| README.md | Documentation explaining usage, features, and implementation details |
| Cargo.toml | Workspace configuration adding WindowsUpdate to build members |
| build.data.json | Build configuration registering the new resource |
| .project.data.json | Project metadata for the WindowsUpdate resource |
| Cargo.lock | Dependency lock file with windows crate additions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PR Summary
Add DSCv3 resource for WindowsUpdate, supports
get,set, andexport. Type isMicrosoft.Windows/UpdateListwhich implies that you're working with an array of updates. Forgetyou must provide eithertitle(exact match) oridto an update and same forsetto work.exportwill accept wildcards for the title as a filter. Multiple properties in an export input object will be treated as logical AND while multiple objects in the export input is treated as logical OR.When using
getorset, if all the input objects do not result in a match to an update, then that is an error. When usingexportand any input filter does not match an update, that is an error.