vSphere PowerCLI Reference

New-Folder

Synopsis

Creates a new folder on a vSphere server.

Syntax

New-Folder [-Name] <String> [-Location] <VIContainer> [-Server <VIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>]

Related Commands

Online version
Get-Folder
Move-Folder
Remove-Folder
Set-Folder

Detailed Description

Creates a new folder on the specified location.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
NameStringSpecify a name for the new folder.truefalse
LocationVIContainerSpecify a container object (folder, datacenter, or cluster) where you want to place the new folder. If a datacenter is specified for the -Location parameter, then the folder is created in its "hostFolder" folder and contains hosts and clusters. The "hostFolder" is a system folder and is guaranteed to exist.truetrue (ByValue)
ConfirmSwitchParameterIf the value is $true, indicates that the cmdlet asks for confirmation before running. If the value is $false, the cmdlet runs without asking for user confirmation.falsefalse$true
ServerVIServer[]Specify the vSphere servers on which you want to run the cmdlet. If no value is given to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.falsefalse
WhatIfSwitchParameterIndicate that the cmdlet is run only to display the changes that would be made and actually no objects are modified.falsefalse

Return Type

Folder

Notes

Examples

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

New-Folder -Name Folder1 -Location Folder2

Creates a new folder named Folder1 in the Folder2 folder.


Copyright © 1998 - 2011 VMware, Inc. All rights reserved.