New-Datacenter

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

Syntax

[-Location]  <VIContainer>
-Name  <String>
[-Server  <VIServer[]>]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
required
Location
VIContainer 1
  • wildcards
  • pipeline
  • Specifies the location where you want to create the new datacenter.
    required
    Name
    String named Specifies a name for the new datacenter.
    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

    Feedback

    Was this page helpful?