Peel the potatoes and slice them thinly using a mandoline for even cooking. If you don’t have one, a sharp knife works too—just try to keep slices uniform. Set aside the slices in a bowl while you prepare the sauce.
Melt butter in a medium saucepan over medium heat, then whisk in flour until combined. Slowly add milk while whisking constantly, then stir in salt, garlic powder, onion powder, oregano, thyme, and pepper. Simmer for about 10 minutes until thickened, then fold in Gruyere and Parmesan until smooth.
Grease your baking dish and layer half the potato slices. Pour over half of the cheesy sauce, then repeat with the remaining potatoes and sauce. Top with extra Gruyere and Parmesan for a beautifully golden crust.
Cover the dish with foil and bake at 400˚F for 25 minutes. Remove the foil and bake for an additional 20-25 minutes until the potatoes are tender and the top is golden brown. Let it sit for 10 minutes before serving to let the sauce set.