Preheat oven to 400 degrees F. Spray an 11 x 7-inch baking dish with cooking spray and set aside.
In a deep skillet or sauce pan combine the butter over medium heat, add the shallot, then garlic. Sauté until fragrant.
Stir in the milk, heavy cream, shredded cheddar, gouda, salt and pepper. Bring the mixture to a simmer, stirring occasionally. When the mixture has thickened remove from the heat and set aside.
Layer half the thinly sliced potatoes in the casserole dish, top with chopped ham and half of the cheese mixture.
Layer the rest of the potatoes, ham and cheese sauce in the casserole dish.
Top with shredded cheddar cheese and bake 20-25 minutes until the potatoes are cooked through (check with a fork)
Allow the dish to rest at least 10 minutes before serving.
Serving: 1 slice (about 2.75" x 3.5"), Calories: 388kcal, Carbohydrates: 31g, Protein: 17g, Fat: 22g, Saturated Fat: 12g, Polyunsaturated Fat: 7g, Cholesterol: 75mg, Sodium: 707mg, Fiber: 3g, Sugar: 5g