VMware Cloud Community
mythrandir52
Contributor
Contributor
Jump to solution

Child folders under the root of Host and clusters

I am trying to get a list of child folders under hosts and clusters. I need to generat a list of folder directly below a given folder but i have have no luck. Can anyone help?

get-folder | get-childitem

Truth is a three edged sword

Truth is a three edged sword
Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

In the VI hierarchy of objects there are some hidden folders present.

These you don't see in the VIC but you can see them with Managed Object Browser (http://<VC-server>/mob).

For the folders created under the Hosts & Clusters node you can do

Get-Folder Datacenters | Get-Folder -NoRecursion

The folder Datacenters is the hidden folder that corresponds with the Hosts & Clusters node.

Since you only want to see the child folders we add the parameter -NoRecursion.


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

View solution in original post

Reply
0 Kudos
1 Reply
LucD
Leadership
Leadership
Jump to solution

In the VI hierarchy of objects there are some hidden folders present.

These you don't see in the VIC but you can see them with Managed Object Browser (http://<VC-server>/mob).

For the folders created under the Hosts & Clusters node you can do

Get-Folder Datacenters | Get-Folder -NoRecursion

The folder Datacenters is the hidden folder that corresponds with the Hosts & Clusters node.

Since you only want to see the child folders we add the parameter -NoRecursion.


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

Reply
0 Kudos