Hello Experts,
I am new to VMware environment, and We have a small setup with Free license ESXI Host.
I uploaded some windows 2016.ISO file to datastore and created a VM.
Now I am trying to create a Template out of it and create a New VM with that template. And also store that template in datastore
I am using the commands below to create a Template:
$EXSI_HOST = ""
$HostUsername = ""
$HostPassword = ""
$Datastore = ""
$sourceVMName = ""
$TemplateName = ""
# Connect to the ESXi host or vCenter Server
Connect-VIServer -Server $EXSI_HOST -User $HostUsername -Password $HostPassword
$SourceVM = (Get-VM -Name $sourceVMName).Name
$datacenter = (Get-Datacenter).Name
$datastore = (Get-Datastore -Name $Datastore).Name
$Template = New-Template -VM $SourceVM -Location $datacenter -Name $TemplateName -Datastore $datastore -Confirm:$false
But I am unable to create the template. Getting below error:
New-Template: 7/27/2023 9:00:04 PM New-Template The operation for the entity "Template_VM" failed with the following message: "The operation is not supported on the object."

Need some inputs on this. Even when I logged in the same in the ESXI UI
