Preheat your oven to 350°F (175°C).
Grease a 9x13 inch baking dish with olive oil.
In a large bowl, combine the diced potatoes, cubed ham, and chopped onion.
In another bowl, mix sour cream, milk, garlic powder, salt, and pepper.
Pour the sour cream mixture over the potato and ham mixture.
Stir in half of the shredded cheddar cheese.
Transfer the mixture into the greased baking dish.
Top with the remaining cheddar cheese.
Cover the dish with aluminum foil and bake for 30 minutes.
Remove the foil and bake for an additional 15 minutes until golden and bubbly.