Preheat oven to 350 degrees. Lightly grease a 9×13 inch baking dish.
Spread hashbrowns in an even layer in the bottom of the prepared pan.
In a large bowl, whisk together eggs, milk, salt, onion powder, garlic powder, pepper and cayenne. Pour over hashbrowns.
Sprinkle with half of the cheese, all of the bacon, then the remaining cheese. Cover tightly with foil.
Bake for 1 hour, then remove foil and bake for another 5-10 minutes, or until center is set and a knife inserted in the casserole comes out clean. Let stand 5-10 minutes before serving. Garnish with chopped green onions, if desired.