- Preheat oven to 375°F (190°C). 
- In a skillet over medium heat, melt butter and add sliced onions. Cook for 10–15 minutes, stirring occasionally, until caramelized. 
- Season the onions with salt, pepper, and thyme. Stir in cream, milk, and garlic powder, and let simmer for 2–3 minutes. 
- In a greased 9×13 baking dish, layer half of the potato slices. Pour half of the onion mixture over them, then sprinkle with half of the cheese. Repeat layers. 
- Cover with foil and bake for 35 minutes. Remove foil and bake uncovered for another 20–25 minutes, or until potatoes are tender and the top is golden and bubbly. 
- Let rest for 5 minutes, sprinkle with parsley if using, and serve warm.