Preheat your oven to 400°F and lightly grease a 9x13 baking dish.
In a medium saucepan, melt the butter over medium heat. Stir in the diced onions and cook until soft—about 3 to 4 minutes.
Sprinkle the flour into the pan and stir constantly for about a minute to create a roux.
Slowly whisk in the heavy cream and milk, and keep whisking until the mixture begins to thicken.
Add the garlic powder, salt, and pepper, then fold in the cheddar and Parmesan cheeses. Stir until melted and smooth.
Layer half of the sliced potatoes into the prepared dish. Pour half of the cheese sauce over the top. Repeat with the remaining potatoes and sauce.
Cover the dish with foil and bake for 45 minutes. Then remove the foil and bake for another 15 minutes until the top is golden and bubbly.
Let it sit for a few minutes before garnishing with parsley and serving.