New-Datacenter Command | Vmware PowerCLI Reference

New-Datacenter

This cmdlet creates a new datacenter in the location that is specified by the Location parameter.

Syntax

New-Datacenter
[ -Location ] < VIContainer >
-Name < String >
[-ProgressAction < ActionPreference > ]
[-Server < VIServer[] > ]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Location VIContainer 1
  • pipeline
  • wildcards
Specifies the location where you want to create the new datacenter.
required
Name String named
Specifies a name for the new datacenter.
optional ProgressAction ActionPreference named
optional Server VIServer[] named
  • wildcards
Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null 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.

Output

VMware.VimAutomation.ViCore.Types.V1.Inventory.Datacenter

Examples

Example 1

$folder = Get-Folder -NoRecursion | New-Folder -Name Folder

New-Datacenter -Location $folder -Name Datacenter | fl

Gets the inventory root folder and create a new folder called Folder in it. Creates a new datacenter called Datacenter in the Folder folder. The result is pipelined to the fl command to retrieve a flat view of the new datacenter properties.

Related Commands

Datacenter

This cmdlet retrieves the datacenters available on a vCenter Server system.

This cmdlet moves a vCenter Server datacenter from one location to another.

This cmdlet creates a new datacenter.

This cmdlet removes the specified datacenters from their locations.

This cmdlet modifies the properties of the specified datacenter.