From b54d352a6973a4915a59d878ab4734ed00ae09db Mon Sep 17 00:00:00 2001 From: Andrea Scarpino Date: Wed, 3 Aug 2016 11:05:08 +0200 Subject: [PATCH] win_firewall_rule: fix "property X doesn't exist" After commit 9392943 more properties are always sets with their defaults values (e.g. service to 'any'). This causes no issue when the rule is created, but causes an error message that says "The property 'X' cannot be found on this object. Verify that the property exists." because the module checks for any property value that has changed, but `netsh advfirewall firewall show rule` does not list any property unless `verbose` is set. This patch solves this. Fixes #2624 --- lib/ansible/modules/extras/windows/win_firewall_rule.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/windows/win_firewall_rule.ps1 b/lib/ansible/modules/extras/windows/win_firewall_rule.ps1 index 31aa2741cd..a63cedec0c 100644 --- a/lib/ansible/modules/extras/windows/win_firewall_rule.ps1 +++ b/lib/ansible/modules/extras/windows/win_firewall_rule.ps1 @@ -24,7 +24,7 @@ function getFirewallRule ($fwsettings) { try { #$output = Get-NetFirewallRule -name $($fwsettings.'Rule Name'); - $rawoutput=@(netsh advfirewall firewall show rule name="$($fwsettings.'Rule Name')") + $rawoutput=@(netsh advfirewall firewall show rule name="$($fwsettings.'Rule Name')" verbose) if (!($rawoutput -eq 'No rules match the specified criteria.')){ $rawoutput | Where {$_ -match '^([^:]+):\s*(\S.*)$'} | Foreach -Begin { $FirstRun = $true;