< Back
New-Folder
Post
NAME New-Folder
SYNOPSIS
This cmdlet creates a new folder on a vCenter Server system.
SYNTAX
New-Folder [-Name] <String> [-Location] <VIContainer> [-Server <VIServer[]>] [-Confirm] [-WhatIf]
[<CommonParameters>]
DESCRIPTION
This cmdlet creates a new folder on the specified location.
PARAMETERS
-Location <VIContainer>
Specifies a container object (folder or datacenter) 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.
Required? true
Position? 2
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? true
-Name <String>
Specifies a name for the new folder.
Required? true
Position? 1
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Server <VIServer[]>
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this
parameter, the command runs on the default servers. For more information about default servers, see the
description of Connect-VIServer.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? true
-Confirm [<SwitchParameter>]
If 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.
Required? false
Position? named
Default value $true
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are
modified.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
The newly created Folder object
NOTES
-------------------------- Example 1 --------------------------
New-Folder -Name "Folder1" -Location (Get-Datacenter)[0]
Creates a new folder in a datacenter root.
-------------------------- Example 2 --------------------------
Get-Folder | Select -First 1 | New-Folder -Name "Folder2"
Creates a nested folder by using a pipeline command.
-------------------------- Example 3 --------------------------
New-Folder -Name "FirstLevelFolder1" -Location (Get-Folder vm)
Creates a new folder in the root vSphere virtual machine folder.
RELATED LINKS
Online Version: https://code.vmware.com/doc/preview?id= ... older.html
Get-Folder
Move-Folder
Remove-Folder
Set-Folder
SYNOPSIS
This cmdlet creates a new folder on a vCenter Server system.
SYNTAX
New-Folder [-Name] <String> [-Location] <VIContainer> [-Server <VIServer[]>] [-Confirm] [-WhatIf]
[<CommonParameters>]
DESCRIPTION
This cmdlet creates a new folder on the specified location.
PARAMETERS
-Location <VIContainer>
Specifies a container object (folder or datacenter) 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.
Required? true
Position? 2
Default value None
Accept pipeline input? True (ByValue)
Accept wildcard characters? true
-Name <String>
Specifies a name for the new folder.
Required? true
Position? 1
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Server <VIServer[]>
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is passed to this
parameter, the command runs on the default servers. For more information about default servers, see the
description of Connect-VIServer.
Required? false
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? true
-Confirm [<SwitchParameter>]
If 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.
Required? false
Position? named
Default value $true
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are
modified.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
OUTPUTS
The newly created Folder object
NOTES
-------------------------- Example 1 --------------------------
New-Folder -Name "Folder1" -Location (Get-Datacenter)[0]
Creates a new folder in a datacenter root.
-------------------------- Example 2 --------------------------
Get-Folder | Select -First 1 | New-Folder -Name "Folder2"
Creates a nested folder by using a pipeline command.
-------------------------- Example 3 --------------------------
New-Folder -Name "FirstLevelFolder1" -Location (Get-Folder vm)
Creates a new folder in the root vSphere virtual machine folder.
RELATED LINKS
Online Version: https://code.vmware.com/doc/preview?id= ... older.html
Get-Folder
Move-Folder
Remove-Folder
Set-Folder