How do I use get-template in VMware PowerCLI for multiple directory levels

StackOverflow https://stackoverflow.com/questions/15908778

  •  03-04-2022
  •  | 
  •  

Вопрос

In my vCenter cluster, I have the following directory structure to store templates

Templates
   Project1Templates
      Linux-OS-Template
      Windows-OS-Template

What is the syntax for the get-template comdlet to get the template name in the Project1Template sub-folder when scripting?

Это было полезно?

Решение 2

Per noam's suggestion, here's the answer I got from the PowerCLI community:

Get-Folder -Name Templates |
Get-Folder -Name Project1Teamplates |
Get-Template -Name Linux-OS-template 

Credit to RvdNieuwendijk for the answer: http://communities.vmware.com/message/2225618#2225618

Другие советы

get-folder templates | get-folder Project1Templates | get-template -name Linux-OS-Template

Or maybe I'm still fuzzy on the question.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top