Preheat the oven to 400°F (200°C). Grease a 9x13-inch (23x33-cm) baking dish with non-stick cooking spray
Peel the potatoes, then shred on the large holes of a box grater. Transfer to a large bowl of water and swirl around to remove excess starch. Drain and rinse, then place the potatoes in a clean kitchen towel and squeeze until they’re completely dry.
Add the shredded potatoes to a clean, large bowl with the salt, pepper, garlic powder, cayenne, onion powder, Parmesan cheese, and olive oil. Toss until fully combined.
Transfer the potato mixture to the baking dish. Spread evenly.
Bake for 1½ hours, or until the potatoes are tender throughout and golden brown on the top and bottom.
Press the bottom of a glass into the potato mixture to create 6 evenly spaced wells.
Shingle slices of cheddar cheese and ham around the wells, then crack an egg into each one.
Bake for 15 minutes more, or until the cheese melts and the egg whites are set. The egg yolks should still be slightly soft.