Hello, Santosh-
You can do these tasks as follows:
## name of template to handle
$strTemplateName = "myTemplate0"
## convert template to VM, saving output VM to new variable
$vmToHandle = Set-Template $strTemplateName -ToVM -Confirm:$false
## power on the VM
Start-VM $vmToHandle -Confirm:$false
## shutdown the VM (assumes it is running VMware Tools)
Shutdown-VMGuest $vmToHandle -Confirm:$false
## convert VM to tempalte
Set-VM $vmToHandle -ToTemplate -Confirm:$false
Notice that the VM shutdown assumes that the VM is running VMware Tools. If you want to just force a poweroff of the VM, you can use the Stop-VM cmdlet.
Enjoy.