1. Preheat oven to 230°C. Line a large roasting pan with non-stick baking paper. Place the pumpkin, oil, salt and pepper in a bowl. Toss to combine. Spread over the lined pan and roast for 30 minutes or until almost tender.
  2. Meanwhile, cook the spaghetti in a large saucepan, according to packet instructions or until al dente. Drain, reserving 2 tablespoons of the cooking liquid. Return the pasta to the pan. Cover and set aside.
  3. Add the asparagus and ham to the pumpkin. Toss to combine. Roast for a further 10 minutes.
  4. Add the spinach, reserved cooking liquid, roasted ham mixture and pesto to the pan. Toss until well combined and the spinach wilts. Serve immediately.