def get_winrm_port_forwarding_rule(server, cached_rules=nil)
      rules = cached_rules || list_port_forwarding_rules || []
      rules.find_all { |r|
        r['virtualmachineid'] == server['id'] &&
           (r['privateport'] == '5985' &&
            r['publicport'] == '5985') ||
           (r['privateport'] == '5986' &&
            r['publicport'] == '5986')
      }.first
    end
def get_winrm_port_forwarding_rule(server, cached_rules=nil)
      rules = cached_rules || list_port_forwarding_rules || []
      rules.find_all { |r|
        r['virtualmachineid'] == server['id'] &&
           (r['privateport'] == '5985' &&
            r['publicport'] == '5985') ||
           (r['privateport'] == '5986' &&
            r['publicport'] == '5986')
      }.first
    end
Gets the WINRM port forwarding rule for the specified server.