With the New-VM cmdlet and the VM and the OSCustomizationSpec parameters you can do exactly that.
The NumCpu and MemeoryGB parameters allow you to configure the new VM.
There are several examples of scripts to perform such a cloning process available in this community.
For example see
Do you already have an idea how you are going to provide the customisation parameters ?
In a CSV file ?