Sorry, I couldn't get it work. In the near future we will run vW 8.6, I will try it again then. For now I fixed it with CmdLets from HyperV 2012 R2 $VMTemplate = ((Get-VM -Name $VM).Id | Get-VHD).ParentPath  I split and convert this to the correct template name.
Does anybody know/got the command (powershell) to return the template name of a VM?
Powershell - Return the template name of a running VM