Add Microsoft.Windows/Service resource#1426
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new DSC v3 bundled resource Microsoft.Windows/Service (Rust executable windows_service) to manage Windows Services, including manifest/schema, implementation for get/set/export, and Pester coverage. This integrates the new resource into the workspace/build packaging so it can be built and shipped with the rest of the repo’s resources.
Changes:
- Introduces the
Microsoft.Windows/Serviceresource manifest with an embedded JSON schema and security context requirement forset. - Implements Windows Service querying/configuration via Win32 Service APIs (
OpenSCManagerW,OpenServiceW,QueryServiceConfigW,ChangeServiceConfigW, etc.) and line-delimited export output. - Adds Pester tests for
get,set, andexport, and wires the new crate/resource into the workspace and build metadata.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/windows_service/windows_service.dsc.resource.json | New resource manifest + embedded schema and operation wiring |
| resources/windows_service/src/main.rs | CLI entrypoint implementing get/set/export protocol |
| resources/windows_service/src/service.rs | Core Win32 SCM/service interaction logic |
| resources/windows_service/src/types.rs | Data model + enums for service properties |
| resources/windows_service/locales/en-us.toml | i18n strings for errors/messages |
| resources/windows_service/Cargo.toml | New Rust crate definition for the resource |
| resources/windows_service/.project.data.json | Build metadata for the resource packaging |
| resources/windows_service/tests/windows_service_get.tests.ps1 | Pester tests for get behavior |
| resources/windows_service/tests/windows_service_set.tests.ps1 | Pester tests for set behavior (admin-gated) |
| resources/windows_service/tests/windows_service_export.tests.ps1 | Pester tests for export behavior and filtering |
| data.build.json | Adds resource to build outputs and project list |
| Cargo.toml | Adds crate to workspace members/default-members + Windows group + windows feature |
| Cargo.lock | Adds new crate entry to lockfile |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
resources/windows_service/tests/windows_service_export.tests.ps1
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2e208a9 to
9665673
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
PR Summary
Add
Microsoft.Windows/Serviceresource for managing Windows Services. Supportsget,set, andexport