Skip to content

feat: Add --what-if for Microsoft.Windows/FirewallRuleList#1530

Open
Gijsreyn wants to merge 3 commits into
PowerShell:mainfrom
Gijsreyn:gh-1529/main/add-whatif-firewall
Open

feat: Add --what-if for Microsoft.Windows/FirewallRuleList#1530
Gijsreyn wants to merge 3 commits into
PowerShell:mainfrom
Gijsreyn:gh-1529/main/add-whatif-firewall

Conversation

@Gijsreyn
Copy link
Copy Markdown
Collaborator

PR Summary

This pull request adds --what-if support for Microsoft.Windows/FirewallRuleList. It also updates the SKILL.md file for re-usability across other resources created.

PR Context

Partially addresses #1529

Copilot AI review requested due to automatic review settings May 13, 2026 05:44
Copy link
Copy Markdown
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 first-class --what-if support for the built-in Microsoft.Windows/FirewallRuleList resource by wiring the manifest to pass a what-if flag through to windows_firewall set, projecting state instead of mutating, and surfacing what-if messages via _metadata.whatIf. Also extends the skill documentation with a reusable what-if implementation/testing pattern.

Changes:

  • Resource manifest: add whatIfArg and whatIfReturns for the set operation, plus schema support for _metadata.whatIf.
  • Resource implementation: add -w/--what-if parsing and implement non-mutating projections (create/update/delete) with localized what-if messages.
  • Tests/docs: add a Pester suite for what-if and expand .github/skills/create-dsc-resource/SKILL.md with what-if guidance.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
resources/windows_firewall/windows_firewall.dsc.resource.json Wires DSC what-if invocation (whatIfArg, whatIfReturns) and extends schema with _metadata.whatIf.
resources/windows_firewall/src/main.rs Parses -w/--what-if and passes it into set_rules.
resources/windows_firewall/src/firewall.rs Implements what-if behavior by projecting results instead of mutating and emitting _metadata.whatIf messages for create/remove.
resources/windows_firewall/src/types.rs Adds _metadata model (Metadata) to the rule type for what-if message payloads.
resources/windows_firewall/locales/en-us.toml Adds localized what-if strings for create/remove messages.
resources/windows_firewall/tests/windows_firewall_whatif.tests.ps1 Adds Pester coverage for what-if create/update/delete/multi-rule behavior.
.github/skills/create-dsc-resource/SKILL.md Documents a standardized what-if pattern for manifests, implementation, localization, and tests.

Comment thread resources/windows_firewall/windows_firewall.dsc.resource.json
Comment thread resources/windows_firewall/src/firewall.rs Outdated
Comment thread resources/windows_firewall/tests/windows_firewall_whatif.tests.ps1 Outdated
Comment thread resources/windows_firewall/tests/windows_firewall_whatif.tests.ps1
Comment thread .github/skills/create-dsc-resource/SKILL.md
Comment thread .github/skills/create-dsc-resource/SKILL.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants