In a VMware vSphere environment, you can use folders to organize your infrastructure. In the vSphere web client, you can create folders in the Hosts and Clusters
, VMs and Templates
, Storage
, and Networking
inventories. The following screenshot shows an example of folders in the VMs and Templates
inventory:
You can browse through these folders using the PowerCLI Inventory Provider. PowerCLI also has a set of cmdlets to work with these folders: Get-Folder
, Move-Folder
, New-Folder
, Remove-Folder
, and Set-Folder
.
You can use the Get-Folder
cmdlet to get a list of all of your folders:
PowerCLI C:\> Get-Folder
Otherwise, you can select specific folders by their name using the following command line:
PowerCLI C:\> Get-Folder -Name "Accounting"
All folders are organized in a tree structure under the root folder. You can retrieve the root folder with the following command:
PowerCLI C:\> Get-Folder -NoRecursion Name Type ---- ...