Yes, but what different your solution is doing compare to the one in my script attached. I think you misunderstood my question, I wanted to know how should i avoid time to bring the windows machine ready to use after power on, Since it reports successful VM creation after which it perform complete initialization as if we setting up new machine from scratch. It perform reboot etc.
But we need only two thing computerName and IP address. So we need new VM to have these value set and rest of the value should not required to set as its already contain all the required information as its taking clone from snapshot.