Also, side note. Can you loop through things in your configuration?
So instead of:
# Install the IIS role WindowsFeature IIS { Ensure = "Present" Name = "Web-Server" } # Install the ASP .NET 4.5 role WindowsFeature AspNet45 { Ensure = "Present" Name = "Web-Asp-Net45″ }
Could you have an arrary with the all the features you want "Present"?