Heat the oven to 375°F (190°C). Lightly grease a 9-by-13-inch baking dish. If the hash browns are still icy, thaw them and pat them dry so the casserole is not watery.
Warm the olive oil in a skillet over medium heat. Add the onion and bell pepper and cook for 5 to 7 minutes, stirring, until softened. Let cool briefly.
Spread the hash browns in the baking dish. Scatter the sautéed vegetables and optional ham over the potatoes, then sprinkle the cheddar evenly on top.
Whisk the eggs, milk, salt, pepper, and garlic powder in a bowl until combined. Pour the egg mixture evenly over the casserole.
Bake uncovered for 45 to 55 minutes, until the center is set and an instant-read thermometer inserted in the middle reads 160°F (71°C). If the top browns too quickly, loosely cover it with foil for the remaining bake time.
Rest the casserole for 10 minutes before cutting. Add scallions if desired and serve warm.