PowerShell / PowerShell/DSC

Add support for `actions`

Open
#1,470 14 comments 2 reactions 1 assignee View on GitHub

@SteveL-MSFT is already working on this.

Since Sep 2, 2026.

Issue-Enhancement
Dominant language
Rust
Stars
523
Forks
75
Avg merge
3d 16h
Merged PRs (30d)
24

Description

Summary of the new feature / enhancement

As part of configuring a service, like sshd, the changes don't take effect until after the service is restarted. This can, today, be worked around by using the Microsoft.Windows/Service to stop and start it, but an action to restart would be better and also only restart if settings have changed since restarting a service can, for example, disconnect active clients.

Proposed technical implementation details (optional)

Ideally, it would work like:

$schema: https://aka.ms/dsc/schemas/v3/bundled/config/document.json
resources:
- name: Install PowerShell 7
  type: Microsoft.WinGet/Package
  properties:
    id: Microsoft.PowerShell
- name: Install SSHD
  type: Microsoft.Windows/FeatureOnDemandList
  properties:
    capabilities:
    - identity: OpenSSH.Server~~~~0.0.1.0
      state: Installed
- name: Add PS7 SSH Subsystem
  type: Microsoft.OpenSSH.SSHD/Subsystem
  properties:
    subsystem:
      name: powershell
      value: C:/progra~1/powershell/7/pwsh.exe -sshs
- name: Restart SSHD, if changed
  type: Microsoft.WIndows.Action/RestartService
  condition: "[stateChanged(resourceId('Microsoft.OpenSSH.SSHD/Subsystem','Add PS7 SSH Subsystem'))]"
  properties:
    name: sshd

This would need a new stateChanged() function that takes a resourceId() and returns true only if that resource resulted in a state change. Otherwise, the restart would be skipped.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.