Remove the husk and silk of the corn and cut in half. If grilling, preheat the grill. Place the corn directly on the grill and cook for about 3 minutes, then turn the corn to continue cooking other sides. Continue this until all sides are cooked. If using a nonstick pan, preheat the pan over medium heat, add the olive oil. Add the corn and cook for 3 minutes, then turn to continue cooking the other sides of the corn. Continue this until all sides are cooked.
While the corn is cooking, prepare the sauce. Add the mayonnaise, garlic powder, onion powder, chili powder, salt, lime juice, and chopped cilantro into a small bowl. Stir together until combined.
After the corn is cooked, remove it to a plate. Brush or spread the sauce onto the entire corn cob and serve.