Rinse your rice and let it sit while you get ready for it.
Put the whole spices (cardamom, peppercorns, cloves, and cinnamon) into a muslin bag or a spice infuser and crush slightly.
Heat your pot and when it's hot, add the ghee and let it melt.
When it's hot enough to shimmer, add the cumin seeds and let them splutter. It will sound like popcorn starting to pop. If you're NOT using a muslin bag for your spices, you will add all spices at this point.
Add the sliced onions and salt and cook until the edges are crisp. You want them cooked but not burned (see pic).
Add the rice and mix until each grain is coated with ghee.
Add water and bag of spices and set it for 6 minutes at High Pressure.
For basmati, it's very important to let it steam for 10 minutes AFTER it's done its cooking. I opened up the instant Pot and stirred it once, and then closed it back up and let it rest again. You could add defrosted green peas at this point if you like.
That's it. Your Pilau is ready to serve.
Making Basmati Rice:
If you're making this in a rice cooker, it's simple enough, just turn it on and walk away.
If you're making this on the stove top, you want the water to come to a boil and as soon as it does, stir once, turn heat to low, set your timer for 20 minutes and DO NOT mess with it until it's done or you'll break the rice.
If you want to make this with brown rice, add one cup of water. Set the Instant Pot to 22 minutes High Pressure, and 10 minutes Natural Pressure Release.