In a large bowl, combine dry pasta, spaghetti sauce, ham, garlic, onion powder and pepper. Fill sauce jar with water, and pour over mixture. Mix well, and spoon into 9x13 inch casserole dish. Cover tightly with foil.
Bake in preheated oven for 35 minutes. Carefully remove foil, then sprinkle with mozzarella and Parmesan cheese. Bake for 5 minutes, or until cheese is melted.