Preheat oven to 375°F and spray a 9x13-inch baking dish with cooking spray.
Dump the uncooked macaroni, cubed ham, and 2 cups of the shredded cheese into the prepared baking dish.
In a medium bowl, whisk together the cream of mushroom soup, milk, sour cream, garlic powder, and black pepper until smooth, then pour over the macaroni mixture and stir to combine.
Cover tightly with aluminum foil and bake for 40 minutes.
Remove foil, sprinkle remaining 1 cup cheese on top, and bake uncovered for 5 more minutes until cheese is melted and bubbly.
Let stand for 5 minutes before serving.