Heat ghee in a non stick pan, add coconut and saute. Grind pineapple slices and add to the coconut and mix well. Add sugar and stir till sugar melts.
Add green cardamom powder and mix. Cook till all the moisture is absorbed and the mixture forms a lump. Add powdered sugar and mix well.
Grease an aluminium burfi tray with ghee and transfer the coconut mixture onto it. Spread it evenly and set aside to cool.
Cut into squares and serve.