If making your own pie crust, roll it out and press it into a deeper 9.5-inch quiche pan or a more shallow 11-inch quiche pan, pressing into the corners; use a rolling pin to trim excess dough, line the crust with parchment paper, and fill with pie weights or dry beans or rice.
Preheat the oven to 425°F and blind-bake the crust for 12 to 15 minutes. Remove the pie weights and parchment, reduce the oven temperature to 375°F, and bake the crust for an additional 5 minutes.
If using store-bought pastry, follow the package instructions for prepping or prebaking the crust instead of the homemade crust steps.
Melt the butter in a large skillet over medium-high heat. Add the chopped shallots and cook 2 to 3 minutes until soft and translucent, season with pepper, then add the chopped spinach and cook about 2 to 3 minutes until wilted. Remove from heat and let the spinach mixture cool slightly.
In a medium bowl, whisk the eggs and heavy cream together until well combined.
Sprinkle half of the shredded Gruyère over the bottom of the precooked crust, spread the cooled spinach and shallot mixture over the cheese, then carefully pour the egg and cream mixture over the filling. Top with the remaining Gruyère.
Place the assembled quiche on a baking sheet and bake at 375°F for 35 to 40 minutes, or until the top is golden and the center is slightly jiggly but mostly set.
Allow the quiche to cool and set for 10 to 20 minutes, then cut into slices and serve warm or at room temperature.