Preheat your oven to 350°F (175°C).
Grease a baking dish with butter.
Layer half of the sliced potatoes in the dish.
Sprinkle half of the diced ham over the potatoes.
Sprinkle half of the shredded cheese on top.
In a bowl, mix the heavy cream, chopped onion, garlic powder, salt, and pepper.
Pour half of the cream mixture over the layered ingredients in the dish.
Repeat the layering process with the remaining potatoes, ham, cheese, and cream mixture.
Finish with a sprinkle of paprika on top for color.
Cover the dish with foil and bake for 45 minutes, then remove the foil and bake for an additional 15 minutes until golden brown.