Skip to content

docs: Add reference documentation for Microsoft.Windows/FirewallRuleList#1523

Merged
SteveL-MSFT merged 1 commit into
PowerShell:mainfrom
Gijsreyn:update-winfirewall-docs
May 12, 2026
Merged

docs: Add reference documentation for Microsoft.Windows/FirewallRuleList#1523
SteveL-MSFT merged 1 commit into
PowerShell:mainfrom
Gijsreyn:update-winfirewall-docs

Conversation

@Gijsreyn
Copy link
Copy Markdown
Collaborator

@Gijsreyn Gijsreyn commented May 9, 2026

PR Summary

This pull request adds reference documentation for the built-in DSC resource Microsoft.Windows/FirewallRuleList.

Copilot AI review requested due to automatic review settings May 9, 2026 10:18
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 reference documentation and examples for the built-in DSC resource Microsoft.Windows/FirewallRuleList, describing its schema, capabilities, and common usage patterns for getting/setting/exporting Windows Firewall rules.

Changes:

  • Added a full resource reference page including properties, schema, exit codes, and links to examples.
  • Added a “get/toggle/export” CLI example page for dsc resource usage.
  • Added a configuration-document example (YAML) plus a walkthrough for dsc config test/set and rule removal.

Reviewed changes

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

File Description
docs/reference/resources/Microsoft/Windows/FirewallRuleList/index.md New reference page for the resource (syntax, properties, schema, exit codes, links).
docs/reference/resources/Microsoft/Windows/FirewallRuleList/examples/get-firewall-rules.md New CLI-oriented example for get/set/export behavior.
docs/reference/resources/Microsoft/Windows/FirewallRuleList/examples/firewall.config.dsc.yaml New sample DSC config document defining two firewall rules.
docs/reference/resources/Microsoft/Windows/FirewallRuleList/examples/configure-firewall-rules.md New walkthrough demonstrating config test/set and rule removal.

Comment thread docs/reference/resources/Microsoft/Windows/FirewallRuleList/index.md Outdated
@Gijsreyn
Copy link
Copy Markdown
Collaborator Author

Gijsreyn commented May 9, 2026

@SteveL-MSFT - one of the remarks from Copilot was the min/max on the protocol property. Even though, when running it, for example, with 257, the executable throws a useful error message. However, I have updated the resource manifest to include both minimum and maximum, as I do think it adds value for authoring-time feedback and fails early without spawning a process.

If not, let me know, and I'll remove it from the docs.

Comment on lines +70 to +74
> [!IMPORTANT]
> The `_exist` property on a rule item behaves differently from most DSC resources. When a rule
> exists in the Windows Firewall store, `_exist` is **omitted** from the returned state (absent
> means present). When a rule is not found, `_exist: false` appears in the response. This means
> that a missing `_exist` field in the actual state always indicates the rule exists.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Out of scope for this PR, but we should consider altering this behavior for the next release.

_exist is a canonical property with strong contracts. We shouldn't have any resources that implement a canonical property in a surprising way that requires callouts like this.

It's always an optional field to send to the resource, because the default is true, but we should always return the fully defined actual state of the resource, including _exist as either true or false.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Canonical _exist defaults to true so it should be canonical that absence means it exists

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Correct, and that's particularly ergonomic from an input-data perspective - but from a result reading perspective, omitting fields to imply their default value is at best confusing.

In this case, we're saving a line in the output YAML at the cost of clarity/explicitness.

For a reader to understand why some results have _exist: false and others omit _exist, the reader needs to either have familiarity either with the canonical property schema contract (and JSON Schema behavior) or have read the documentation.

I think this is a case where not having a resource-authoring guide / checklist leads us to differing implementations. In general, a resource should imo always return the fully explicit data for an instance to reduce the need for dereferencing/contextualizing a result in combination with its JSON Schema.

For canonical properties this is arguably less of a concern, but if a resource defines the optional foo property with a default of bar and doesn't return foo in the output data, should we interpret the instance as having foo set to bar? Can we infer that without looking at the JSON Schema from a higher order tool or uninformed user perspective?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@michaeltlombardi I think we should have a separate discussion on best practices for defaults. We have the same problem for sshd_config and that resource is working towards a particular implementation, but we should discuss it at the WG level on how we want all resources to do that.

@michaeltlombardi michaeltlombardi force-pushed the update-winfirewall-docs branch from 5f6bdab to 77e8a83 Compare May 12, 2026 16:25
Copy link
Copy Markdown
Collaborator

@michaeltlombardi michaeltlombardi left a comment

Choose a reason for hiding this comment

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

Approved for editing pass, ready for final technical review.

@SteveL-MSFT SteveL-MSFT added this pull request to the merge queue May 12, 2026
Merged via the queue into PowerShell:main with commit 7fd3356 May 12, 2026
36 of 37 checks passed
@Gijsreyn Gijsreyn deleted the update-winfirewall-docs branch May 13, 2026 03:45
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.

4 participants