You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting a service's desired status to Running does not restart an already running service. This adds Microsoft.Windows.Action/RestartService for configurations that need an explicit restart on every set operation.
Stop the service, wait for it to stop, then start it and wait for Running. Start an already stopped service without changing its configuration or forcing dependent services to stop.
Require elevation and support non-mutating what-if previews with projected state and _metadata.whatIf.
Replace windows_service.dsc.resource.json with windows_service.dsc.manifests.json, preserving the existing Service resource and adding the action. Update build/package references and documentation.
Add Spooler coverage for repeated restarts, stopped and disabled services, input validation, discovery, and previews, with original state restoration. Scope existing CLI/MCP action-list assertions to test actions so built-in actions do not break their counts.
New restart tests with Pester 5.7.1: 11 passed, 8 skipped.
CLI/MCP action-list regression tests: 2 passed.
Confirmed the existing resource manifest is unchanged semantically and restart preview output matches the action output schema.
Limitation: Elevated restart scenarios could not be exercised because the local session is not running as administrator. Spooler remained stopped and disabled.
Add native service restart handling and combine the Service resource and RestartService action in a manifest list. Include Spooler coverage, what-if support, packaging updates, and action discovery regression adjustments.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The elevated preview test asserts metadata in the wrong location, and incremental builds retain an obsolete manifest that causes duplicate service discovery and fails the count assertion.
Adds Microsoft.Windows.Actions/RestartService for configurations that need an explicit restart on every set operation, rather than only ensuring a service is running.
Changes:
Implements elevated restart execution and non-mutating what-if previews.
Combines the existing Service resource and new action in one manifest list, updating build, packaging, and documentation references.
Adds restart coverage and scopes CLI/MCP action-list assertions to test actions.
Steve Lee (SteveL-MSFT)
changed the title
Add Microsoft.Windows.Actions/RestartService action
Add Microsoft.Windows.Action/RestartService action
Nov 9, 2026
Changed code coverage measures only Rust lines added/modified in this PR.
Full codebase coverage measures all instrumented Rust lines across the project.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The documentation incorrectly locates the configuration preview message at _metadata.whatIf instead of results[0].metadata.whatIf, preventing consumers from finding it at the documented path.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Document the configuration preview at the correct result path
For the documented dsc config set --what-if command, the preview message is exposed at results[0].metadata.whatIf, not _metadata.whatIf: configuration processing moves _metadata out of afterState (lib/dsc-lib/src/configure/mod.rs:400–475). Please distinguish the configuration result path from the raw action output so consumers can locate the preview message.
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
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.
Setting a service's desired status to
Runningdoes not restart an already running service. This addsMicrosoft.Windows.Action/RestartServicefor configurations that need an explicit restart on every set operation.Running. Start an already stopped service without changing its configuration or forcing dependent services to stop._metadata.whatIf.windows_service.dsc.resource.jsonwithwindows_service.dsc.manifests.json, preserving the existing Service resource and adding the action. Update build/package references and documentation.Validation
build.ps1 -Project windows_service -Clippysucceeded.Limitation: Elevated restart scenarios could not be exercised because the local session is not running as administrator. Spooler remained stopped and disabled.