Lightly spray a 9x13" baking dish with nonstick cooking spray. Set aside.
Add the butter & onions to a medium skillet set over medium heat. Sauté the onions, stirring occasionally, just until they're softened and beginning to turn translucent. Remove the skillet from heat & set aside.
To a small mixing bowl add the soup, milk, and garlic powder. Whisk until evenly combined. Set aside.
Add the frozen pierogi to the bottom of the prepared baking dish, spreading out into a roughly even layer.
Spread the sautéed onions & diced ham evenly over top of the pierogi.
Pour the soup mixture evenly out overtop, and then spread the shredded cheese out to cover the dish.
Bake at 350° for an hour.
Remove the casserole from the oven, and let it rest for 5 minutes before serving.
Serve as is, or with sour cream & chives for a garnish- if desired.