VMware Cloud Community
Praveenmna
Enthusiast
Enthusiast

how to get folder information of ESXi host using powercli?

Hi

is there any way to folder information of ESXi host using powercli?

get-folder -location doesn't gives the info .

Thanks,

Praveen P

If you found this or any other answer useful please consider the use of the Helpful or Correct buttons to award points. Praveen P Senior Support Engineer
0 Kudos
3 Replies
LucD
Leadership
Leadership

What info are you looking for ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Praveenmna
Enthusiast
Enthusiast

inside vCenter we have Folders and under that, Clusters and followed by Hosts.

i want to know which hosts are located under which folder?

Thanks in advance,

Praveen P

If you found this or any other answer useful please consider the use of the Helpful or Correct buttons to award points. Praveen P Senior Support Engineer
0 Kudos
LucD
Leadership
Leadership

Does this return the info you are after ?

Get-VMHost |

Select Name,@{N='Folder';E={

    $parent = Get-View -Id $_.ExtensionData.Parent

    while($parent -isnot [VMware.Vim.Folder])

    {

        $parent = Get-view -Id $parent.Parent

    }

    $parent.Name

}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos