def delete_rule(name, localport, protocol='tcp', dir='in'):
    cmd = ['netsh', 'advfirewall', 'firewall', 'delete', 'rule',
           'name={0}'.format(name),
           'protocol={0}'.format(protocol),
           'dir={0}'.format(dir)]

    if 'icmpv4' not in protocol and 'icmpv6' not in protocol:
        cmd.append('localport={0}'.format(localport))

    ret = __salt__['cmd.run'](cmd, python_shell=False)
    if isinstance(ret, six.string_types):
        return ret.endswith('Ok.')
    else:
        log.error('firewall.delete_rule failed: {0}'.format(ret))
        return False
.. versionadded:: 2015.8.0
dataset/ETHPy150Open saltstack/salt/salt/modules/win_firewall.py/delete_rule