Preheat oven to 350°F (175°C) and grease a casserole dish with butter.
Melt butter in a large pot over medium heat. Add flour and whisk for 2 minutes to form a roux.
Slowly add milk and cream while whisking until smooth and thickened.
Add salt, pepper, onion powder, and garlic powder. Mix well.
Remove from heat and stir in half of the cheese until melted.
Slice potatoes thinly (about 1/8 inch thick).
Add sliced potatoes to the sauce and mix gently to coat evenly
Transfer mixture into the prepared baking dish.
Sprinkle remaining cheese evenly on top.
Cover with foil and bake for 60 minutes.
Remove foil and bake for 20–25 minutes until golden and tender.
Let rest for 15 minutes before serving.