Preheat your oven to 375°F (190°C).
Grease a 9x13 inch baking dish with unsalted butter.
In a saucepan, heat the heavy cream over medium heat. Add garlic powder, salt, and black pepper, stirring until well combined. Warm for about 5 minutes without boiling.
Layer half of the sliced Yukon Gold potatoes evenly in the prepared dish. Sprinkle half of the chopped onions on top.
Pour half of the warm cream mixture over the first layer of potatoes.
Sprinkle half of the shredded cheddar cheese over the cream.
Repeat the layering with the remaining potatoes, onions, cream mixture, and cheddar cheese, finishing with a final layer of cheese on top.
Cover the baking dish with aluminum foil and bake in the preheated oven for 45 minutes.
Remove the foil and continue to bake for an additional 15 minutes or until the top is golden brown and bubbly.
Once done, remove from the oven and let it rest for about 10 minutes before serving. Garnish with fresh parsley if desired.