I want to clone Windows VM.
I tried your script. It works - new VM is created with new name as expected.
It started automatically into UEFI shell.
I stopped it and looked into the settings of a VM, and found out a setting "Unraid Source Path:" which still points to original appdata folder. I don't know if this is OK. Anyway I created new folder in appdata (using WinSCP with root privilege), and changed this setting to point this new folder.
Started VM again and it was running UEFI shell again. Using "exit" command, I got UEFI settings.
I choose "continue" option, and it started Windows installation process, where I could choose OS version and other installation stuff.
I expected cloning VM creates new VM with everything installed (no need to go through installation of windows again).
Probably I don't understand the process.