I'm not sure if it loses its effectiveness, but garlic becomes much less pungent when you bake it slowly in an oven. So, if you really want to make your own hair care products featuring garlic, you might try doing that.
Be careful how you cook it though. It really needs a slow heat. I tried cooking garlic bulbs in a microwave once and it almost immediately turned black and then caught on fire. The smell was really bad and the burn marks wouldn't come off the bowl. Even when I tried again and watched carefully, it was difficult to get to the point between cooked and completely toasted.
So, use an oven instead if you want to make garlic shampoo. Your kitchen will thank you.