powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Get-Folder



NAME
Get-Folder

SYNOPSIS
Retrieves the folders available on a vSphere server.

SYNTAX
Get-Folder [-Location ] [-Type ] [[-Name] ] [-Id ] [-NoRecursion]
[-Server ] []


DESCRIPTION
Retrieves the folders available on a vSphere server. The cmdlet returns a set of folders that correspond to the fil
ter criteria provided by the cmdlet parameters. To specify a server different from the default one, use the -Server
parameter.


PARAMETERS
-Location
Specify vSphere container objects (folders, datacenters, or clusters) you want to search for folders.

Required? false
Position? named
Default value
Accept pipeline input? true (ByValue)
Accept wildcard characters? true

-Type
Specify the type of the folders you want to retrieve. The valid values are VM, HostAndCluster, Datastore, Netwo
rk, and Datacenter.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Name
Specify the names of the folders you want to retrieve.

Required? false
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? true

-Id
Specify the IDs of the folders you want to retrieve.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true

-NoRecursion
Indicate that you want to disable the recursive behavior of the command.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false

-Server
Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the co
mmand runs on the default servers. For more information about default servers, see the description of Connect-V
IServer.

Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? true


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS



OUTPUTS
Folder


NOTES




-------------- Example 1 --------------

C:\PS>$server = Connect-VIServer -Server 10.23.112.235

Get-Folder -Server $server -Name Folder


Retrieves the folder named Folder on the server with IP address 10.23.112.235.





-------------- Example 2 --------------

C:\PS>Get-Folder -NoRecursion


Retrieves the root folder.





-------------- Example 3 --------------

C:\PS>Get-Folder -Location $folder


Gets all folders in the specified location.





-------------- Example 4 --------------

C:\PS>$folder = Get-Folder | Select -first 1

Get-Folder -ID $folder.ID


Gets a folder by ID.





-------------- Example 5 --------------

C:\PS>Get-Folder -Type Network


Gets all network folders.






RELATED LINKS
Online version: http://www.vmware.com/support/developer/PowerCLI/PowerCLI501/html/Get-Folder.html
New-Folder
Remove-Folder
Set-Folder
Move-Folder