From 79874591747c456c396111fc373634a011d82085 Mon Sep 17 00:00:00 2001 From: webalexeu <28548335+webalexeu@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:02:49 +0200 Subject: [PATCH] Fixing creation of rule when multiple icmp_type are defined --- CHANGELOG.md | 14 ++++++++++++++ lib/ps/windows_firewall/ps-bridge.ps1 | 14 +++++++------- metadata.json | 2 +- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05dd8c3..7dc5957 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. +## Release 1.5.2 (2024-09-02) + +[Full Changelog](https://github.com/webalexeu/puppet-windows_firewall/compare/v1.5.1...v1.5.2) + +**Features** + +**Bugfixes** + +- [Cannot create rule when multiple icmp_type are defined](https://github.com/webalexeu/puppet-windows_firewall/issues/33) + +**Known Issues** + ## Release 1.5.1 (2024-08-24) [Full Changelog](https://github.com/webalexeu/puppet-windows_firewall/compare/v1.5.0...v1.5.1) @@ -14,6 +26,8 @@ All notable changes to this project will be documented in this file. **Known Issues** +- Cannot create rule when multiple icmp_type are defined + ## Release 1.5.0 (2024-06-07) [Full Changelog](https://github.com/webalexeu/puppet-windows_firewall/compare/v1.4.2...v1.5.0) diff --git a/lib/ps/windows_firewall/ps-bridge.ps1 b/lib/ps/windows_firewall/ps-bridge.ps1 index 00cb87c..1e8ed82 100644 --- a/lib/ps/windows_firewall/ps-bridge.ps1 +++ b/lib/ps/windows_firewall/ps-bridge.ps1 @@ -167,12 +167,12 @@ function create { if ($ProtocolCode) { $params.Add("ProtocolCode", $ProtocolCode) } - if ($IcmpType) { - $params.Add("IcmpType", $IcmpType) - } - # `$LocalPort` and `$RemotePort` will always be strings since we were + # `$IcmpType, `$LocalPort` and `$RemotePort` will always be strings since we were # invoked with `powershell -File`, rather then refactor the loader to use # `-Command`, just do a simple string split + if ($IcmpType) { + $params.Add("IcmpType", ($IcmpType -split ',')) + } if ($LocalPort) { $params.Add("LocalPort", ($LocalPort -split ',')) } @@ -268,12 +268,12 @@ function update { if ($ProtocolCode) { $params.Add("ProtocolCode", $ProtocolCode) } + # `$IcmpType, `$LocalPort` and `$RemotePort` will always be strings since we were + # invoked with `powershell -File`, rather then refactor the loader to use + # `-Command`, just do a simple string split if ($IcmpType) { $params.Add("IcmpType", ($IcmpType -split ',')) } - # `$LocalPort` and `$RemotePort` will always be strings since we were - # invoked with `powershell -File`, rather then refactor the loader to use - # `-Command`, just do a simple string split if ($LocalPort) { $params.Add("LocalPort", ($LocalPort -split ',')) } diff --git a/metadata.json b/metadata.json index 6e5b263..182a06f 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "webalex-windows_firewall", - "version": "1.5.1", + "version": "1.5.2", "author": "webalex", "summary": "Manage the windows firewall with Puppet", "license": "Apache-2.0",