Bring a large pot of salted water to a boil. Add the dried pasta and cook according to the package instructions until al dente. Drain in a colander and set aside.
In a saucepan over medium heat, melt the butter. Once melted, add the flour and whisk continuously for about 1 minute until it forms a smooth paste (this is called a roux).
Gradually pour in the milk while continuing to whisk until the mixture is smooth and starts to thicken, which should take about 3-5 minutes.
Lower the heat and add the shredded cheese, garlic powder, onion powder, salt, and pepper. Stir until the cheese melts and the sauce is creamy.
Add the drained pasta to the cheese sauce. Stir well to ensure all pasta is coated with the sauce.
Cook for an additional 2-3 minutes on low heat, then remove from heat.
Transfer the cheesy pasta to a serving dish and garnish with chopped fresh parsley if desired.