Preheat oven to 400 degrees F (200 degrees C).
Cut 5 squares of aluminum foil 1 1/2 times the size of the ears of corn; place each ear of corn in the center of a piece of foil.
Stir mayonnaise, Parmesan cheese, chili powder, ground black pepper, and fresh parsley together in a bowl until it forms a thick paste; rub about 2 tablespoons of the paste over each ear of corn. Wrap the aluminum foil around the corn and seal. Arrange corn on a baking sheet.
Bake in preheated oven for 10 minutes, turn, and continue baking another 10 minutes.