Add WindowsUpdate resource#1351
Merged
SteveL-MSFT merged 9 commits intoPowerShell:mainfrom Jan 14, 2026
Merged
Conversation
3c5e1fa to
4541bc0
Compare
Contributor
There was a problem hiding this comment.
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.
resources/WindowsUpdate/tests/windowsupdate.executable.tests.ps1
Outdated
Show resolved
Hide resolved
resources/WindowsUpdate/tests/windowsupdate.executable.tests.ps1
Outdated
Show resolved
Hide resolved
Member
Author
|
This was partially Copilot generated code and looks good enough for a preview release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.