Prepare a 9x13 inch baking dish with butter or non-stick cooking spray, and preheat the oven to 375 degrees f.
Melt the butter in a medium saucepan over medium heat. Once fully melted stir in the flour, salt, pepper, garlic powder, and onion powder.
¼ cup unsalted butter, ¼ cup all-purpose flour, ½ teaspoon salt, ¼ teaspoon black pepper, ¼ teaspoon garlic powder, ¼ teaspoon onion powder
Cook the flour mixture, stirring constantly until the mixture is bubbling.
Gradually whisk in the milk, stirring constantly until the sauce thickens.
2 cups milk
Take the saucepan from the heat, and mix in 1 cup of shredded cheddar cheese, and the parmesan cheese. Stir until smooth.
1 ½ cups shredded sharp cheddar cheese, ½ cup grated Parmesan cheese
Place a layer of potatoes and ham in the bottom of the casserole dish. Using about ⅓ of the potatoes and ham.
1 ½ cups diced ham, 4 cups potatoes
Pour ¼ of the cheese sauce over the potato layer, and then repeat building layers until all ingredients are used.
Sprinkle the remaining cheddar cheese over the top of the casserole.
1 ½ cups shredded sharp cheddar cheese
Cover with foil and bake in the oven for 45 minutes.
Remove the foil and return to the oven for an additional 15-20 minutes or until the top is golden brown and bubbly.
Allow the casserole to cool slightly before garnishing with fresh parsley and serving.
Fresh parsley