如何在VMware PowerCLI中为多个目录级别使用get模板

如何在VMware PowerCLI中为多个目录级别使用get模板,vmware,powercli,Vmware,Powercli,在我的vCenter集群中,我有以下目录结构来存储模板 Templates Project1Templates Linux-OS-Template Windows-OS-Template 编写脚本时,get template comdlet在Project1Template子文件夹中获取模板名称的语法是什么 get-folder templates | get-folder Project1Templates | get-template -name Linux-

在我的vCenter集群中,我有以下目录结构来存储模板

Templates
   Project1Templates
      Linux-OS-Template
      Windows-OS-Template
编写脚本时,get template comdlet在Project1Template子文件夹中获取模板名称的语法是什么

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

或者我对这个问题还不太清楚。

根据诺姆的建议,以下是我从PowerCLI社区得到的答案:

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

答案要归功于RvdNieuwendijk:

您想要Project1Templates文件夹中的模板列表,或者您想要使用get template检索文件夹名称,或者其他什么?无论哪种方式,如果您还没有查看论坛,您可能需要查看论坛。我希望获取模板以检索模板名称。我做$ATEMPLANT=获取模板,并希望$ATEMPLATE将一个模板中的一个模板作为其值。考虑将有用的信息添加到答案中,而不是简单地链接到它。通过链接给予信任。试想一下,如果链接停止工作,这个答案对未来的访问者有多大用处。