Skip to content

Add Microsoft.Windows/Service resource#1426

Merged
SteveL-MSFT merged 15 commits intoPowerShell:mainfrom
SteveL-MSFT:windows-service-resource
Mar 14, 2026
Merged

Add Microsoft.Windows/Service resource#1426
SteveL-MSFT merged 15 commits intoPowerShell:mainfrom
SteveL-MSFT:windows-service-resource

Conversation

@SteveL-MSFT
Copy link
Member

PR Summary

Add Microsoft.Windows/Service resource for managing Windows Services. Supports get, set, and export

@SteveL-MSFT SteveL-MSFT added Doc-Impact Schema-Impact Change requires updating a canonical schema for configs or manifests labels Mar 11, 2026
@SteveL-MSFT SteveL-MSFT requested a review from Copilot March 11, 2026 21:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/Service resource manifest with an embedded JSON schema and security context requirement for set.
  • 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, and export, 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@SteveL-MSFT SteveL-MSFT force-pushed the windows-service-resource branch from 2e208a9 to 9665673 Compare March 12, 2026 23:54
@SteveL-MSFT SteveL-MSFT marked this pull request as ready for review March 13, 2026 01:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@SteveL-MSFT SteveL-MSFT merged commit 608339e into PowerShell:main Mar 14, 2026
19 checks passed
@SteveL-MSFT SteveL-MSFT deleted the windows-service-resource branch March 14, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Doc-Impact Schema-Impact Change requires updating a canonical schema for configs or manifests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants