Book Image

Learning PowerCLI for VMware VSphere

By : Robert van den Nieuwendijk
Book Image

Learning PowerCLI for VMware VSphere

By: Robert van den Nieuwendijk

Overview of this book

Table of Contents (17 chapters)
Learning PowerCLI
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Working with vSphere folders


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 vSphere 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

Or you can select specific folders by 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:

PowerCLI C:\> Get-Folder -NoRecursion

Name                           Type
----                           ----
Datacenters...