Prepare pie crust: If you're making your own pie crust, roll it out and place it in a deeper 9.5-inch quiche pan or a more shallow 11-inch quiche pan, pressing into the corners. Use a rolling pin to roll over the surface of the quiche pan, to cut off the excess dough from the edges. Line the crust with parchment paper and fill it with pie weights or dry beans or rice.
Blind bake the crust: Preheat the oven to 425°F. Bake for 12 to 15 minutes. Remove the pie weights and parchment paper. Reduce the oven heat to 375°F and bake the crust for an additional 5 minutes.
For store bought pastry: If using store bought pastry, follow the instructions on the package.
Cook the spinach: Add the butter to a large skillet and melt over medium-high heat. Add the shallots and cook for 2 to 3 minutes or until soft and translucent. Season with pepper. Add the chopped spinach and cook for about 2 to 3 minutes until cooked down. Let it cool slightly.
Combine eggs and heavy cream: In a medium sized bowl add the eggs and heavy cream. Whisk well.
Assemble the quiche: Sprinkle half the cheese over the bottom of the precooked crust then top with spinach filling. Carefully pour the egg mixture over the spinach. Top with remaining gruyere cheese.
Bake: Transfer the quiche onto a baking sheet and bake for 35 to 40 minutes at 375°F until the top is golden. The center should be a bit jiggly but the rest should be set.
Rest and serve: Let the quiche cool for 10 to 20 minutes, allowing the quiche to fully set. Cut into slices and serve either warm or at room temperature.