Implement what-if functionality for Windows service operation#1507
Open
Gijsreyn wants to merge 3 commits intoPowerShell:mainfrom
Open
Implement what-if functionality for Windows service operation#1507Gijsreyn wants to merge 3 commits intoPowerShell:mainfrom
Gijsreyn wants to merge 3 commits intoPowerShell:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds native what-if support for the Microsoft.Windows/Service command resource so dsc resource set --what-if can return a projected afterState plus _metadata.whatIf entries without changing the actual service.
Changes:
- Introduces
_metadata.whatIfmodeling on theWindowsServicetype for what-if projections. - Extends the
setoperation plumbing to parse a what-if flag and return projected state/messages (including delete projections when_exist:false). - Adds Pester coverage for what-if projections and new localized what-if strings.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/windows_service/tests/windows_service_set.tests.ps1 | Adds Pester tests validating projected state and _metadata.whatIf for what-if set/delete scenarios. |
| resources/windows_service/src/types.rs | Adds _metadata / Metadata types to the resource’s JSON model. |
| resources/windows_service/src/service.rs | Implements what-if projection logic for set and delete operations; updates set_service signature. |
| resources/windows_service/src/main.rs | Parses --what-if and routes set requests accordingly (including delete projection). |
| resources/windows_service/locales/en-us.toml | Adds user-facing what-if messages and updates usage text. |
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
Adds what-if support for
Microsoft.Windows/Serviceset operations so the resource can return projected state and_metadata.whatIfdetails without changing the service.PR Context
Fixes #1506