I had a need to enable CPU and Memory hotadd to many virtual machines prior to a template being updated, doing some research there is no easy way, however there are some functions out there to do it. You can copy and paste each function into a powershell window and then run the associated command.
Enable Memory HotAdd
Disable Memory HotAdd
Enable CPU HotAdd
Disable CPU HotAdd
Notes: Enabling CPU Hotadd disables vNUMA. So enable enable this if its really neccessary in your environment.