Add oil to saucepan on the stove on medium-low heat, or alternatively, use the inner pot of an Instant Pot pressure cooker. Select Sauté function, Low for 10 minutes.
When the oil is hot, add and sauté onions.
When onions are soft, add cream, milk, garlic powder, onion powder and fresh thyme to the pot. Whisk them together.
Once the mixture is simmered, add flour. Bring to boil, while continuing to whisk.
Add salt and pepper and let it boil for 1 more minute.
Turn off the stove and set saucepan aside, or select CANCEL button on the pressure cooker and remove the inner pot.
Layer potatoes in the bakeware. Sprinkle salt and black pepper between layers.
Pour the cream sauce on top of the potatoes.
Layer Gruyere cheese slices on top.
Sprinkle grated parmesan cheese.
Cover the bakeware with a lid or aluminum foil.
Place oven rack at the bake level in the Omni.
Select BAKE. Set temperature to 375° F and set time for 40 minutes. Press START.
When the oven is hot, place bakeware on the oven rack.
After 30 minutes cooking time, take the foil off. Bake uncovered for 10 more minutes.
When the program ends, keep the potatoes in the oven for 5 minutes.
Take out and let rest for 5 minutes outside the oven, before serving.