The enable parameter is a boolean, then convert to a boolean. (#1607)

At the moment, this only works when 'enable' is equals to 'yes' or 'no'.

While I'm on it, I also fixed a typo in the example and added a required
parameter.
reviewable/pr18780/r1
Andrea Scarpino 9 years ago committed by René Moser
parent 01a15f8a0b
commit 38cb5c6130

@ -212,6 +212,7 @@ $action=Get-Attr $params "action" "";
$misArg = ''
# Check the arguments
if ($enable -ne $null) {
$enable=ConvertTo-Bool $enable;
if ($enable -eq $true) {
$fwsettings.Add("Enabled", "yes");
} elseif ($enable -eq $false) {

@ -114,10 +114,11 @@ EXAMPLES = '''
action: win_firewall_rule
args:
name: smtp
enabled: yes
enable: yes
state: present
localport: 25
action: allow
direction: In
protocol: TCP
'''

Loading…
Cancel
Save