Preheat oven to 425°F. Grease a 2-quart (about 11 x 7-inch or 9-inch square) baking dish or spray with nonstick cooking spray. Set aside.
In a large bowl, whisk together chicken broth and condensed soup until smooth. Add the uncooked spaghetti, ham, mushrooms, garlic, and ground black pepper. Stir to combine everything together.
Transfer the mixture to the prepared baking dish, using your hands or a wooden spoon to gently press all of the ingredients into an even layer. Cover tightly with aluminum foil and bake for 45 minutes.
Uncover; stir gently. At this point, check the pasta to make sure that it is al dente (firm but just about finished cooking). If it’s still too hard, cover the dish and return to the oven until pasta is al dente. Then, move on to the next step.
Stir in the frozen peas and sprinkle the shredded cheese on top. Return the dish to the oven (uncovered), and bake until the pasta is tender and the cheese is melted, about 5-10 more minutes.
Garnish with chopped fresh parsley and serve.