Dear All,
Here is my Vcenter folder tree
When I run Get-Folder -Type Datacenter, I am getting the following result :
Is there anyway to get the first level (Asia and Europe) only?
Thks in advance
JJC
Try like this then
$parent = Get-Folder -Name Datacenters
Get-Folder -Location $parent -NoRecursion
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
These are yellow folders, so they should be located under the hidden 'vm' folder.
The NoRecursion switch limits the results to the first level folders.
Get-Folder -Location (Get-Folder -Name vm) -NoRecursion
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The result with you suggestion give the following
I need to have Asia and Europe in the result without their subfolders.
JJC.
So which is the parent of Asia and Europe?
I can't see that on your screenshot.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
This is the Vcenter server as shown herewith
Try like this then
$parent = Get-Folder -Name Datacenters
Get-Folder -Location $parent -NoRecursion
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That's do the trick
Thks a lot
JJC