We use Hyper-V + SCVMM to host Windows Server 2012 (R2) virtual machines. Currently our deployment procedure includes a lot of PowerShell commands that we have to copy/paste after the VMM template is deployed. For example, some change the NIC names, add a DNS suffix etc.
Is there a way to aggregate these commands into a PowerShell script and let the script run automatically unattended when the VM is booted for the first time? We cannot already set these properties in the template, because for example not all VMs have the same number of NICs.