Spread the sugar on the bottom of the pot. Spread freshly grated lauki on top of the sugar. Do not mix.
Secure lid, close pressure valve and cook for 5 minutes at high pressure.
Quick release pressure.
Press sauté and adjust the heat to the highest setting, then add ghee, milk powder and cardamom and mix well. Let the mixture boil for 5-7 minutes, stirring occasionally. If you are making halwa, you can stop here - otherwise, for burfi continue to the next step.
Continue to let it simmer for another 5 to 7 minutes, stirring more frequently until the mixture dries and you see some ghee coming out of the sides (the amount of time varies depending on the lauki’s water content).
Pour the lauki mixture into a well greased plate/pan (I use an 8x8 glass pan) and sprinkle with chopped pistachios or pumpkin seeds.
Let it cool, then put it in the fridge overnight or until set.
Slice and serve.