From f9fa3303d02f6ff49d10a11f671960a34e796a2f Mon Sep 17 00:00:00 2001 From: "G.Reijn" <26114636+Gijsreyn@users.noreply.github.com> Date: Sat, 9 May 2026 12:17:23 +0200 Subject: [PATCH 1/3] docs: Add reference documentation for Microsoft.Windows/FirewallRuleList --- .../examples/configure-firewall-rules.md | 279 +++++++++ .../examples/firewall.config.dsc.yaml | 26 + .../examples/get-firewall-rules.md | 191 ++++++ .../Windows/FirewallRuleList/index.md | 546 ++++++++++++++++++ 4 files changed, 1042 insertions(+) create mode 100644 docs/reference/resources/Microsoft/Windows/FirewallRuleList/examples/configure-firewall-rules.md create mode 100644 docs/reference/resources/Microsoft/Windows/FirewallRuleList/examples/firewall.config.dsc.yaml create mode 100644 docs/reference/resources/Microsoft/Windows/FirewallRuleList/examples/get-firewall-rules.md create mode 100644 docs/reference/resources/Microsoft/Windows/FirewallRuleList/index.md diff --git a/docs/reference/resources/Microsoft/Windows/FirewallRuleList/examples/configure-firewall-rules.md b/docs/reference/resources/Microsoft/Windows/FirewallRuleList/examples/configure-firewall-rules.md new file mode 100644 index 000000000..0f552ab12 --- /dev/null +++ b/docs/reference/resources/Microsoft/Windows/FirewallRuleList/examples/configure-firewall-rules.md @@ -0,0 +1,279 @@ +--- +description: > + Example showing how to use the Microsoft.Windows/FirewallRuleList resource in a DSC configuration + document to create and enforce Windows Firewall rules. +ms.date: 05/09/2026 +ms.topic: reference +title: Configure firewall rules +--- + +# Configure firewall rules + +This example shows how you can use the `Microsoft.Windows/FirewallRuleList` resource in a DSC +configuration document to create and enforce multiple Windows Firewall rules in a single operation. + +> [!IMPORTANT] +> **Set** operations for this resource require an elevated (administrator) process context. Run +> your terminal or PowerShell session as Administrator before using `dsc config set`. + +## Definition + +The configuration document for this example defines one instance of the `FirewallRuleList` +resource that manages two rules: + +- **DscDemo - Custom App (TCP-In)** — allows inbound TCP traffic on port 8080 for a custom + application, active on the Domain and Private profiles. +- **DscDemo - Block Telnet (TCP-Out)** — blocks all outbound TCP connections to port 23 (Telnet) + on all profiles. + +:::code language="yaml" source="firewall.config.dsc.yaml"::: + +Copy the configuration document and save it as `firewall.config.dsc.yaml`. + +## Test the configuration + +To see whether the rules already exist, use the [dsc config test][01] command. + +```powershell +dsc config test --file ./firewall.config.dsc.yaml +``` + +Because neither rule exists yet, both appear in the actual state with `_exist: false`. DSC +computes the instance as out of desired state and lists `rules` in `differingProperties`. + +```yaml +executionInformation: + duration: