Hello, I have the next problem:
I need to remove template from vCenter via powerCLI, such as i would click mouse2 on template and choose "Delete from Disk".
When I try to do it using this code:
$Templates = Get-Template $TemplateName
Remove-Template $Templates -DeletePermanently -Confirm:$false
template is removed from inventory and all template's files are removed except .vmdk. So, template's folder on datastore and .vmdk file is steel kept.
How can I remove template and all it's files permanently? Do i need to delete folder on datastore separately on the next step? If so, how can I do it? (can't find commandlet for it)
An issue has been resolved. As I understood
Remove-Template $Templates -DeletePermanently -Confirm:$false
work only if $Templates include 1 template, or several different templates. In my case $Templates included 3 objects that relate with 1 template. There were 3 because of I added them to inventory of 2 additional DataCenters.
Which PowerCLI version are you using (do a Get-PowerCLIVersion) ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
VMware vSphere PowerCLI 5.5 Release 1 build 1295336
An issue has been resolved. As I understood
Remove-Template $Templates -DeletePermanently -Confirm:$false
work only if $Templates include 1 template, or several different templates. In my case $Templates included 3 objects that relate with 1 template. There were 3 because of I added them to inventory of 2 additional DataCenters.