add-cidatastore - vcloud snapin cmdlets reference

287
7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 1/287 vSphere PowerCLI Reference Add-CIDatastore Synopsis This cmdlet adds one or more datastores to a provider virtual datacenter (vDC). Syntax Add-CIDatastore -Datastore <Datastore[]> [-ProviderVdc] <ProviderVdc> [-Server <CIServer[]>] [-WhatIf] [-Confirm] [<CommonParameters>] Related Commands Get-CIDatastore Online version Detailed Description This cmdlet adds one or more datastores from a vCenter Server system to a provider virtual datacenter (vDC). Note: This cmdlet is only available to Provider Administrators. Parameters NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE ProviderVdc ProviderVdc Specifies the provider vDC to which you want to add the datastore. true false 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. false false Datastore Datastore[] Specifies one or more datastores from a vCenter Server system that you want to add to a provider vDC. true true (ByValue) Server CIServer [] Specifies the cloud 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-CIServer. false false WhatIf SwitchParameter Indicates that the cmdlet is run only to display the changes that would be made and actually no objects are modified. false false Return Type One or more CIDatastore objects Notes You can run this cmdlet only against vCloud Director 1.5.x environments. Examples -------------- Example 1 -------------- Get-Datastore -Name *cloud* | Add-CIDatastore -ProviderVdc 'MyProviderVdc' Adds all datastores with names that contain "cloud" to the specified provider vDC. Copyright © 1998 - 2013 VMware, Inc. All rights reserved. vSphere PowerCLI Reference Add-DeployRule Synopsis Adds one or more rules to the rule set. Syntax Add-DeployRule [-DeployRule] <DeployRule[]> [[-At] <UInt32>] [-NoActivate] [<CommonParameters>] Related Commands Get-DeployRule New-DeployRule Remove-DeployRule Detailed Description Adds one or more rules to the working rule set and then activates the working rule set. The rule can be added at a specific index with the "-At" option, otherwise it is added to the end. If you plan on making several changes to the rule set, you can pass the "-NoActivate" option to avoid activing the rule set after every change. A rule set is an ordered list of rules that determines what items, such as a host profile, should be associated with a host. For each type of item, AutoDeploy will find a matching rule and select the item specified in that rule. If more than one rule matches a host and the rules contain the same type of item, the item from the rule that comes first in the rule set will be used. This behaviour makes it possible to write a single generic rule that matches many hosts and then write more specific rules to override settings for specialized hosts. The working rule set can be used to test out changes to the rule set against hosts in vCenter Server. Once you are satisfied with the rules, you can activate the working rule set to control how any new hosts that are unknown to vCenter Server will be deployed. You must have the "AutoDeploy.RuleSet.Edit" privilege on the root folder of vCenter Server to use this cmdlet. Parameters NA ME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFA ULT VA LUE DeployRule DeployRule [] Rule(s) to add to the rule set. You can pass a DeployRule object here or the name of the rule. true true (ByValue) At UInt32 Index in the rule set where you want to add the rule. The placement of the rule in the set determines its priority. Lower indexes have a higher priority. false false NoActivate SwitchParameter Specify this parameter to add the rule to the working rule set but not to the active rule set. By default, the working rule set is activated after the change. false false

Upload: sshreddy

Post on 20-Oct-2015

156 views

Category:

Documents


0 download

DESCRIPTION

Add-CIDatastore - VCloud Snapin Cmdlets Reference

TRANSCRIPT

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 1/287

    vSphere PowerCLI Reference

    Add-CIDatastore

    Synopsis

    This cmdlet adds one or more datastores to a provider virtual datacenter (vDC).

    Syntax

    Add-CIDatastore -Datastore [-ProviderVdc] [-Server ] [-WhatIf] [-Confirm] []

    Related Commands

    Get-CIDatastoreOnline version

    Detailed Description

    This cmdlet adds one or more datastores from a vCenter Server system to a provider virtual datacenter (vDC). Note: This cmdlet is only available to ProviderAdministrators.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    ProviderVdc ProviderVdc Specifies the provider vDC to which you want to add the datastore. true false

    Confirm SwitchParameter If the value is $true, indicates that the cmdlet asks for confirmationbefore running. If the value is $false, the cmdlet runs without askingfor user confirmation.

    false false

    Datastore Datastore[] Specifies one or more datastores from a vCenter Server system thatyou want to add to a provider vDC.

    true true (ByValue)

    Server CIServer[] Specifies the cloud servers on which you want to run the cmdlet. Ifno value is given to this parameter, the command runs on thedefault servers. For more information about default servers, see thedescription of Connect-CIServer.

    false false

    WhatIf SwitchParameter Indicates that the cmdlet is run only to display the changes thatwould be made and actually no objects are modified.

    false false

    Return Type

    One or more CIDatastore objects

    Notes

    You can run this cmdlet only against vCloud Director 1.5.x environments.

    Examples

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

    Get-Datastore -Name *cloud* | Add-CIDatastore -ProviderVdc 'MyProviderVdc'

    Adds all datastores with names that contain "cloud" to the specified provider vDC.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Add-DeployRule

    Synopsis

    Adds one or more rules to the rule set.

    Syntax

    Add-DeployRule [-DeployRule] [[-At] ] [-NoActivate] []

    Related Commands

    Get-DeployRuleNew-DeployRuleRemove-DeployRule

    Detailed Description

    Adds one or more rules to the working rule set and then activates the working rule set. The rule can be added at a specific index with the "-At" option, otherwise it isadded to the end. If you plan on making several changes to the rule set, you can pass the "-NoActivate" option to avoid activing the rule set after every change.

    A rule set is an ordered list of rules that determines what items, such as a host profile, should be associated with a host. For each type of item, AutoDeploy will find amatching rule and select the item specified in that rule. If more than one rule matches a host and the rules contain the same type of item, the item from the rule thatcomes first in the rule set will be used. This behaviour makes it possible to write a single generic rule that matches many hosts and then write more specific rules tooverride settings for specialized hosts.

    The working rule set can be used to test out changes to the rule set against hosts in vCenter Server. Once you are satisfied with the rules, you can activate theworking rule set to control how any new hosts that are unknown to vCenter Server will be deployed.

    You must have the "AutoDeploy.RuleSet.Edit" privilege on the root folder of vCenter Server to use this cmdlet.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    DeployRule DeployRule[] Rule(s) to add to the rule set. You can pass a DeployRule object hereor the name of the rule.

    true true (ByValue)

    At UInt32 Index in the rule set where you want to add the rule. The placementof the rule in the set determines its priority. Lower indexes have ahigher priority.

    false false

    NoActivate SwitchParameter Specify this parameter to add the rule to the working rule set but notto the active rule set. By default, the working rule set is activatedafter the change.

    false false

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 2/287

    Return Type

    VMware.DeployAutomation.Types.DeployRuleSet

    Notes

    Examples

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

    C:\PS> Get-DeployRule "testrule" | Add-DeployRule

    Get a rule named "testrule" and add it to the end of the rule set.

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

    C:\PS> Add-DeployRule testrule -At 0

    Add a rule named "testrule" to the beginning of the rule set.

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

    vSphere PowerCLI Reference

    Add-EsxSoftwareDepot

    Synopsis

    Syntax

    Add-EsxSoftwareDepot [-DepotUrl] [-WarningAction ] [-WarningVariable ] []

    Related Commands

    Detailed Description

    Adds an ESX software depot or offline depot ZIP file to the current PowerCLI session. Use this cmdlet right after you start Image Builder by adding the Image Buildersnap-in. The cmdlet imports metadata from the specified depots. You can then create new image profiles and generate ISOs from the image profiles and VIBs in thedepots. The metadata from the depots is kept in memory until the PowerCLI session ends. When you run the cmdlet, Image Builder downloads and parses themetadata from the depot and analyzes the VIBs for dependencies.

    The depot will be added to the list of depots maintained in the implicit session variable $DefaultSoftwareDepots that stores all software depots (similar to$DefaultVIServers).

    If the software depot was previously added, metadata from the depot will be downloaded again.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    DepotUrl String[] Either a string or an array of strings; each string representsthe URL of a depot or a file path to an offline depot ZIP file.The offline depot ZIP file must have the .zip extension.

    true true (ByValue,ByPropertyName)

    WarningAction ActionPreference false false

    WarningVariable String false false

    Return Type

    Notes

    Examples

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

    Add-EsxSoftwareDepot http://www.vmware.com/go/ESXi/patches/

    Connect to a depot.

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

    $depot = Add-EsxSoftwareDepot http://www.vmware.com/go/ESXi/patches/

    Connect to a depot, saving it to a variable.

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

    vSphere PowerCLI Reference

    Add-EsxSoftwarePackage

    Synopsis

    Syntax

    Add-EsxSoftwarePackage [-ImageProfile] [-SoftwarePackage] [-Force] [-WarningAction ] [-WarningVariable] [-WhatIf] [-Confirm] []

    Related Commands

    Detailed Description

    Adds new VIBs to an image profile or updates existing VIBs in an image profile. For each package, if it is newer or older than an existing package in the profile, theexisting package will be replaced. Image Builder performs all image profile validation tests on the modified image profile.

    The output of this cmdlet may be piped into any other cmdlet taking image profiles as input.

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 3/287

    Note that the image profile object that is passed in will have its VibList modified. Please see the New-EsxImageProfile cmdlet for details about persistence of imageprofiles.

    Modification is not possible if the ReadOnly property of an ImageProfile is true.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    ImageProfile ImageProfile (pipeline input, prompt) Image profile to edit.

    Takes one of the following forms:

    *Name of an image profile, as displayed in the Namecolumn of Get-EsxImageProfile, or the Name property ofany ImageProfile object

    *ImageProfile object

    true true (ByValue,ByPropertyName)

    SoftwarePackage SoftwarePackage[] (pipeline input, prompt) List of software packages to addto the profile.

    Takes one of the following forms:

    *Name of a VIB, as displayed in the Name column of Get-EsxSoftwarePackage, or the Name property of anySoftwarePackage object. Image Builder selects the highestavailable version of the named package.

    *" ", for specifying a specific version ofa VIB.

    *SoftwarePackage object

    *GUID of the VIB (from the Guid property of aSoftwarePackage object)

    *A list containing a mix of any of the above

    If more than one vendor provides a package with thesame name, then a non-terminating error results and thecmdlet skips that package.

    true true (ByValue,ByPropertyName)

    Confirm SwitchParameter false false

    Force SwitchParameter Installs packages that break extensibility rules such asstandard file path. Also bypasses dependency checks onpackages. Use this option with care. Because it bypassesstandard validation checks, an invalid image profile mightresult.

    false false

    WarningAction ActionPreference false false

    WarningVariable String false false

    WhatIf SwitchParameter false false

    Return Type

    Notes

    Examples

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

    Add-EsxSoftwarePackage -ImageProfile "My custom profile" -SoftwarePackage net-bnx2

    Add a package by name to an image profile:

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

    Add-EsxSoftwarePackage -ImageProfile "My custom profile" -SoftwarePackage "net-bnx2 1.6.7-0.1OEM1"

    Add a package of a specific name and version:

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

    New-EsxImageProfile -CloneProfile "ESX-5.0-234567-standard" -Name "My custom profile" | \

    Add-EsxSoftwarePackage net-bnx2

    Clone an image profile, then add a package by name, in one line using pipelining:

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

    vSphere PowerCLI Reference

    Add-PassthroughDevice

    Synopsis

    This cmdlet attaches pass-through devices to the specified virtual machine.

    Syntax

    Add-PassthroughDevice [-VM] [-PassthroughDevice] [-Server ] [-WhatIf] [-Confirm] []

    Related Commands

    Online versionGet-PassthroughDeviceRemove-PassthroughDevice

    Detailed Description

    This cmdlet attaches pass-through devices to the specified virtual machine. Note that the value of the ControllerKey property of the returned device might not be up todate, if a new SCSI controller creation process is running in the background.

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 4/287

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    VM VirtualMachine[] Specifies the virtual machine to which you want to attachthe passthrough devices.

    true true (ByValue)

    PassthroughDevice PassThroughDevice[] Specifies the passthrough devices you want to add tothe virtual machine.

    true true (ByValue)

    Confirm SwitchParameter If the value is $true, indicates that the cmdlet asks forconfirmation before running. If the value is $false, thecmdlet runs without asking for user confirmation.

    false false $true

    Server VIServer[] Specifies the vCenter Server instances on which youwant to run the cmdlet. If no value is passed to thisparameter, the command runs on the default servers. Formore information about default servers, see thedescription of Connect-VIServer.

    false false

    WhatIf SwitchParameter Indicates that the cmdlet is run only to display thechanges that would be made and actually no objects aremodified.

    false false

    Return Type

    Zero or more newly added PassthroughDevice objects

    Notes

    Passing PciPassthroughDevice objects to the Device parameter is supported o nly on servers that are vCenter Server 4.0 and ESX 4.0, and higher.

    Examples

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

    $scsiDeviceList = Get-PassthroughDevice -VMHost Host -Type Scsi

    Add-PassthroughDevice -VM $vm -PassthroughDevice $scsiDeviceList[0]

    Adds the first SCSI passthrough device of the Host host to the $vm virtual machine.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Add-VDSwitchPhysicalNetworkAdapter

    Synopsis

    This cmdlet adds host physical network adapters to a distributed switch.

    Syntax

    Add-VDSwitchPhysicalNetworkAdapter [-VMHostNetworkAdapter] [-DistributedSwitch] [-Server ] [-WhatIf] [-Confirm][]

    Related Commands

    Online versionRemove-VDSwitchPhysicalNetworkAdapter

    Detailed Description

    This cmdlet adds host physical network adapters to a distributed switch.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    VMHostNetworkAdapter PhysicalNic[] Specifies the host physical network adapters that youwant to add to the distributed switch.

    true false

    DistributedSwitch DistributedSwitch Specifies the distributed switch to which you want toadd the host physical network adapter.

    true true (ByValue)

    Confirm SwitchParameter If the value is $true, indicates that the cmdlet asks forconfirmation before running. If the value is $false, thecmdlet runs without asking for user confirmation.

    false false

    Server VIServer[] Specifies the vCenter Server systems on which youwant to run the cmdlet. If no value is given to thisparameter, the command runs on the default servers.For more information about default servers, see thedescription of Connect-VIServer.

    false false

    WhatIf SwitchParameter Indicates that the cmdlet is run only to display thechanges that would be made and actually no objectsare modified.

    false false

    Return Type

    None

    Notes

    Examples

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

    $vmhostNetworkAdapter = Get-VMHost "MyVMHost" | Get-VMHostNetworkAdapter -Physical -Name vmnic2

    Get-VDSwitch "MyVDSwitch" | Add-VDSwitchPhysicalNetworkAdapter -VMHostNetworkAdapter $vmhostNetworkAdapter

    Retrieves the specified physical network adapter from the specified host and adds it to the specified distributed switch.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 5/287

    Add-VDSwitchVMHost

    Synopsis

    This cmdlet adds hosts to the specified distributed switch.

    Syntax

    Add-VDSwitchVMHost -VDSwitch -VMHost [-Server ] [-RunAsync] [-WhatIf] [-Confirm] []

    Related Commands

    Online versionRemove-VDSwitchVMHost

    Detailed Description

    This cmdlet adds hosts to the specified distributed switch. The physical network adapters of the hosts are not connected to the distributed switch.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    Confirm SwitchParameter If the value is $true, indicates that the cmdlet asks for confirmationbefore running. If the value is $false, the cmdlet runs without asking foruser confirmation.

    false false

    RunAsync SwitchParameter Indicates that the command returns immediately without waiting forthe task to complete. In this mode, the output of the cmdlet is a Taskobject. For more information about the RunAsync parameter run "helpAbout_RunAsync" in the vSphere PowerCLI console.

    false false

    Server VIServer[] Specifies the vCenter Server systems on which you want to run thecmdlet. If no value is given to this parameter, the command runs on thedefault servers. For more information about default servers, see thedescription of Connect-VIServer.

    false false

    VDSwitch VDSwitch Specifies the distributed switch to which you want to add one or morehosts.

    true true (ByValue)

    VMHost VMHost[] Specifies the hosts that you want to add to the distributed switch. true false

    WhatIf SwitchParameter Indicates that the cmdlet is run only to display the changes that wouldbe made and actually no objects are modified.

    false false

    Return Type

    None

    Notes

    Examples

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

    Get-VDSwitch -Name "MyDistributedSwitch" | Add-VDSwitchVMHost -VMHost "VMHost1", "VMHost2"

    Adds two hosts to the specified distributed switch.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Add-VMHost

    Synopsis

    This cmdlet adds a host to be managed by a vCenter Server instance.

    Syntax

    Add-VMHost [-Name] [-Port ] [-Location] [-Credential ] [-User ] [-Password ] [-Force] [-RunAsync] [-Server ] [-WhatIf] [-Confirm] []

    Related Commands

    Online versionGet-VMHostMove-VMHostRemove-VMHostRestart-VMHostSet-VMHostStart-VMHostStop-VMHostSuspend-VMHost

    Detailed Description

    This cmdlet adds a host to be managed by a vCenter Server instance. The host is added to the datacenter or folder specified by the Location parameter. One of theUser/Password and Credential parameters must be provided in order to authenticate with the host. If both are specified, the Credential parameter is used and theUser and Password parameters are ignored.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    Name String Specifies the name of the host you want to add to a vCenter Serverinstance.

    true false

    Location VIContainer Specifies a datacenter or folder where you want to place the host. true true (ByValue)

    Confirm SwitchParameter If the value is $true, indicates that the cmdlet asks for confirmationbefore running. If the value is $false, the cmdlet runs without askingfor user confirmation.

    false false $true

    Credential PSCredential Specifies a PSCredential object that contains credentials forauthenticating with the virtual machine host.

    false false

    Force SwitchParameter Indicates that the cmdlet runs even if the authenticity of the host SSLcertificate cannot be verified.

    false false

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 6/287

    Password String Specifies the password you want to use for authenticating with thehost.

    false false

    Port Int32 Specifies the port on the host you want to use for the connection. false false For ESX 2.xhosts this isthe authd port(902 bydefault). ForESX 3.x andabove this isthe https port(443 bydefault).

    RunAsync SwitchParameter Indicates that the command returns immediately without waiting forthe task to complete. In this mode, the output of the cmdlet is a Taskobject. For more information about the RunAsync parameter run "helpAbout_RunAsync" in the vSphere PowerCLI console.

    false false

    Server VIServer[] Specifies the vCenter Server instances on which you want to run thecmdlet. If no value is passed to this parameter, the command runs onthe default servers. For more information about default servers, seethe description of Connect-VIServer.

    false false

    User String Specifies the user name you want to use for authenticating with thehost.

    false false

    WhatIf SwitchParameter Indicates that the cmdlet is run only to display the changes that wouldbe made and actually no objects are modified.

    false false

    Return Type

    The newly added VMHost object

    Notes

    Add-VMHost works only if there is a connection to vCenter Server.

    Examples

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

    $myServer = Connect-VIServer -Server 10.23.112.235

    Add-VMHost -Server $myServer -Name MyVMHost1 -Location MyDatacenter1 -User MyUsername1 -Password MyPassword1

    Adds a VM host to a specified vCenter Server system and provides a username and password for authentication.

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

    $myCredentials = Get-VICredentialStoreItem -File "C:\MyCredentials.xml"

    $myServer = Connect-VIServer -Server 10.23.112.235

    Add-VMHost -Server $myServer -Name MyVMHost1 -Location MyDatacenter1 -Credentials $myCredentials

    Adds a VM host to a vCenter Server system and specifies a PSCredential object that contains authentication credentials.

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

    $myCredentials = Get-VICredentialStoreItem -File "C:\MyCredentials.xml"

    $myServer = Connect-VIServer -Server 10.23.112.235

    Add-VMHost -Server $server -Name MyVMHost1 -Location MyDatacenter1 -Credentials $myCredentials -Port MyVMHostPortNumber1 -Confirm:$false

    Adds a VM host to a vCenter Server system without asking for confirmation and specifies a port on the host for connecting.

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

    $myCredentials = Get-VICredentialStoreItem -File "C:\MyCredentials.xml"

    $myServer = Connect-VIServer -Server 10.23.112.235

    Add-VMHost -Server $myServer -Name MyVMHost1 -Location MyDataCenter1 -Credentials $myCredentials -Port MyVMHostPortNumber1 -Force

    Adds a VM host to a vCenter Server system even if the authenticity of the host SSL certificate cannot be verified.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Add-VmHostNtpServer

    Synopsis

    This cmdlet adds the specified NTP servers to the NTP server list of the specified hosts.

    Syntax

    Add-VmHostNtpServer [-NtpServer] [-VMHost] [-Server ] [-WhatIf] [-Confirm] []

    Related Commands

    Online versionGet-VMHostNtpServerRemove-VMHostNtpServer

    Detailed Description

    This cmdlet adds the specified NTP servers to the NTP server list of the specified hosts. If a server is already in the list, a non-terminating error is generated and aduplicate is not created.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    NtpServer String[] Specifies the domain name or the IP address of the NTP server youwant to add to the host.

    true false

    VMHost VMHost[] Specifies a host to which you want to add the NTP server. true true (ByValue)

    Confirm SwitchParameter If the value is $true, indicates that the cmdlet asks for confirmationbefore running. If the value is $false, the cmdlet runs without asking

    false false $true

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 7/287

    for user confirmation.

    Server VIServer[] Specifies the vCenter Server instances on which you want to run thecmdlet. If no value is passed to this parameter, the command runs onthe default servers. For more information about default servers, seethe description of Connect-VIServer.

    false false

    WhatIf SwitchParameter Indicates that the cmdlet is run only to display the changes that wouldbe made and actually no objects are modified.

    false false

    Return Type

    Zero or more System.String objects

    Notes

    Examples

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

    Add-VmHostNtpServer -NtpServer "ntp-server-name.com" -VMHost $vmhost

    Adds the NTP server with a domain name "ntp-server-name.com" to the virtual machine hosts stored in the $vmhost variable.

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

    Add-VmHostNtpServer -NtpServer "192.168.1.5" -VMHost (Get-VMHost)

    Adds the NTP server with an IP address "192.168.1.5" to the virtual machine hosts pipelined through the Get-VMHost cmdlet.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Apply-DrsRecommendation

    Synopsis

    This cmdlet applies the specified DRS recommendations.

    Syntax

    Apply-DrsRecommendation [-DrsRecommendation] [-RunAsync] [-WhatIf] [-Confirm] []

    Related Commands

    Online versionGet-DrsRecommendation

    Detailed Description

    This cmdlet applies the specified DRS recommendations.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    DrsRecommendation DrsRecommendation[] Specifies the DRS recommendations you want to apply. true true (ByValue)

    Confirm SwitchParameter If the value is $true, indicates that the cmdlet asks forconfirmation before running. If the value is $false, thecmdlet runs without asking for user confirmation.

    false false $true

    RunAsync SwitchParameter Indicates that the command returns immediatelywithout waiting for the task to complete. In this mode,the output of the cmdlet is a Task object. For moreinformation about the RunAsync parameter run "helpAbout_RunAsync" in the vSphere PowerCLI console.

    false false

    WhatIf SwitchParameter Indicates that the cmdlet is run only to display thechanges that would be made and actually no objectsare modified.

    false false

    Return Type

    None

    Notes

    Examples

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

    Get-DrsRecommendation -Priority 1,2 | Apply-DrsRecommendation

    Retrieves and applies DRS recommendations with priorities 1 and 2.

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

    $drs = Get-DrsRecommendation -Cluster Cluster

    Apply-DrsRecommendation -DrsRecommendation $drs -RunAsync

    Retrieves the DRS recommendations from the Cluster cluster and applies them. The command returns without waiting for the task to complete.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Apply-ESXImageProfile

    Synopsis

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 8/287

    Associates the specified image profile with the specified ESXi system.

    Syntax

    Apply-ESXImageProfile [-ImageProfile] [-Entities] []

    Related Commands

    Get-ESXImageProfileGet-VMHost

    Detailed Description

    Associates the specified image profile with the specified ESXi system. Currently, the Entities parameter can point only to ESXi hosts.

    You must have the "AutoDeploy.Profile.Edit" privilege on the root folder of vCenter Server to use this cmdlet.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    ImageProfile ImageProfile Image profile to associate with the specified ESXi host. true false

    Entities VIObjectCore[] Must be an ESXi host. Use the Get-VMHost PowerCLI cmdlet to find ahost.

    true true (ByValue)

    Return Type

    Notes

    Examples

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

    C:\PS> Apply-ESXImageProfile "MyImage" "h1","h2"

    Associate the "MyImage" image profile with the hosts named "h1" and "h2".

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

    C:\PS> $img = Get-ESXImageProfile -Name "MyImage"

    C:\PS> Apply-ESXImageProfile $img (Get-VMHost "h1")

    Associate an image profile with the host named "h1" using PowerCLI objects.

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

    vSphere PowerCLI Reference

    Apply-VMHostProfile

    Synopsis

    This cmdlet applies a host profile to the specified host or cluster.

    Syntax

    Apply-VMHostProfile [-Entity] [-Profile ] [-Variable ] [-AssociateOnly] [-ApplyOnly] [-RunAsync] [-Server ] [-WhatIf] [-Confirm] []

    Related Commands

    Online versionExport-VMHostProfileGet-VMHostProfileImport-VMHostProfileNew-VMHostProfileRemove-VMHostProfileSet-VMHostProfileTest-VMHostProfileCompliance

    Detailed Description

    This cmdlet applies a host profile to the specified host or cluster. The host or cluster must be in a maintenance mode. If no value is provided to the Profile parameter,the profile currently associated with the host or cluster is applied.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    Entity InventoryItem[] Specifies hosts or clusters to which you want to apply the virtualmachine host profile.

    true true (ByValue)

    ApplyOnly SwitchParameter Indicates whether to apply the host profile to the specified virtualmachine host without associating it.

    false false

    AssociateOnly SwitchParameter Indicates whether to associate the host profile to the specifiedhost or cluster without applying it.

    false false

    Confirm SwitchParameter If the value is $true, indicates that the cmdlet asks for confirmationbefore running. If the value is $false, the cmdlet runs withoutasking for user confirmation.

    false false $true

    Profile VMHostProfile Specifies the host profile you want to apply. false true (ByValue)

    RunAsync SwitchParameter Indicates that the command returns immediately without waitingfor the task to complete. In this mode, the output of the cmdlet isa Task object. For more information about the RunAsync parameterrun "help About_RunAsync" in the vSphere PowerCLI console.

    false false

    Server VIServer[] Specifies the vCenter Server instances on which you want to runthe cmdlet. If no value is passed to this parameter, the commandruns on the default servers. For more information about defaultservers, see the description of Connect-VIServer.

    false false

    Variable Hashtable Specifies a hash table object that provides values for the hostprofile required variables.

    false true (ByValue)

    WhatIf SwitchParameter Indicates that the cmdlet is run only to display the changes thatwould be made and actually no objects are modified.

    false false

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 9/287

    Return Type

    Zero or more VMHost or Cluster or System.Collections.Hashtable

    Notes

    If there are missing values for the required variables, a hash table with t he names of the required variables and the current or default values is ret urned. Otherwise,all directly affected host and cluster objects are return ed. If the cmdlet is run for a cluster with the AssociateOnly parameter set , only the cluster object is returned,but not its hosts.

    Examples

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

    Apply-VMHostProfile -AssociateOnly -Entity $cluster -Profile $profile

    Associates the specified profile to all hosts in the specified cluster.

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

    Apply-VMHostProfile -Entity $vmhost -Profile $profile

    Associates and applies the specified profile to the specified host.

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

    Get-VMHost | Apply-VMHostProfile -ApplyOnly -Profile $profile

    Applies the specified profile to all specified hosts.

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

    Get-VMHost | Apply-VMHostProfile -AssociateOnly -profile $profile

    Asscociates the specified profile to all specified hosts.

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

    Apply-VMHostProfile $vmhost

    Applies the associated host's profile to the host.

    -------------- Example 6 --------------

    $requireInput = Apply-VMHostProfile $vmhost -Profile $profile;

    $requireInput['network.hostPortGroup["key-vim-profile-host-HostPortgroupProfile-VMkernel"].ipConfig.IpAddressPolicy.address'] = '192.168.0.1';

    $requireInput['network.hostPortGroup["key-vim-profile-host-HostPortgroupProfile-VMkernel"].ipConfig.IpAddressPolicy.subnetmask'] = '255.255.255.0';

    Apply-VMHostProfile $vmhost -Profile $profile -Variable $requireInput;

    Applies a profile to host but first assigns values to all required values.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Compare-EsxImageProfile

    Synopsis

    Syntax

    Compare-EsxImageProfile [-ReferenceProfile] [-ComparisonProfile] [-WarningAction ] [-WarningVariable ] [-WhatIf] [-Confirm] []

    Related Commands

    Detailed Description

    Returns an ImageProfileDiff object that specifies whether two profiles have the same VIB list and acceptance level. If two profiles are different, the ImageProfileDiffobject specifies the differences.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    ReferenceProfile ImageProfile (pipeline input, prompt) Specifies the reference imageprofile for comparison.

    Takes one of the following forms:

    *Name of an image profile, as displayed in the Name columnof Get-EsxImageProfile, or the Name property of anyImageProfile object

    *ImageProfile object

    true true (ByValue,ByPropertyName)

    ComparisonProfile ImageProfile (prompt) The image profile to compare against. Takes oneof the following forms:

    *Name of an image profile, as displayed in the Name columnof Get-EsxImageProfile, or the Name property of anyImageProfile object

    *ImageProfile object

    true false

    Confirm SwitchParameter false false

    WarningAction ActionPreference false false

    WarningVariable String false false

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 10/287

    WhatIf SwitchParameter false false

    Return Type

    Notes

    Examples

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

    Compare-EsxImageProfile "Profile 1" "Profile 2"

    Compares Profile 1 with Profile 2.

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

    vSphere PowerCLI Reference

    Connect-CIServer

    Synopsis

    This cmdlet establishes a connection to the specified servers.

    Syntax

    Connect-CIServer [-Server] [-Org ] [-Credential ] [-User ] [-Password ] [-Port ] [-NotDefault] [-SaveCredentials] [-WhatIf] [-Confirm] [] Connect-CIServer [-Server] [-SessionId] [-Port ] [-NotDefault] [-WhatIf] [-Confirm] [] Connect-CIServer -Menu [-WhatIf] [-Confirm] []

    Related Commands

    Online versionDisconnect-CIServer

    Detailed Description

    This cmdlet establishes a connection to the specified cloud servers. The cmdlet starts a new session or re-establishes a previous session with a cloud server using thespecified parameters. If a connection to a server already exists, the cmdlet returns an object which represents the existing connection.

    When you attempt to connect to a server, the server checks for valid certificates. To set the default behavior of PowerCLI when no valid certificates are recognized, usethe InvalidCertificateAction parameter of the Set-PowerCLIConfiguration cmdlet. For more information about invalid certificates, run 'Get-Help about_invalid_certificates'.

    PowerCLI for vCloud supports a list of default servers. If the target servers cannot be determined from the specified parameters, the cmdlet runs against the servers inthe default server list. All default servers are kept in a global array variable called $DefaultCIServers. When you connect to a server, the server is added at thebeginning of the array, unless the NotDefault parameter is specified. When you disconnect from a server, the server is removed from the $DefaultCIServers variable.You can modify the value of the $DefaultCIServers variable manually.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    Server String[] Specifies the IP or DNS addresses of the cloud servers you wantto connect to.

    true false

    SessionId String Specifies the ID of an existing cloud server session you want toreestablish.

    true false

    Confirm SwitchParameter If the value is $true, indicates that the cmdlet asks forconfirmation before running. If the value is $false, the cmdletruns without asking for user confirmation.

    false false

    Credential PSCredential Specifies a PSCredential object that contains credentials forauthenticating with the server. For more information about theserver authentication logic of PowerCLI, run "helpabout_server_authentication".

    false false

    Menu SwitchParameter Indicates that you want to select a server from a list of recentlyconnected servers. If Menu is set to $true, the cmdlet retrievesa list of the last visited servers and enters a nested commandprompt, so that you can select a server from the list.

    true false

    NotDefault SwitchParameter Specifies that you do not want to save the specified servers asdefault servers.

    false false

    Org String Specifies the name of the organization you want to manage. Bydefault, it is the System organization to which you must connectto. The value of the Org parameter overrides the domain part ofthe value provided to the User parameter.

    false false

    Password String Specifies the password you want to use for authenticating withthe server. If the Credential parameter is also specified, thisparameter is ignored. For more information about the serverauthentication logic of PowerCLI, run "helpabout_server_authentication".

    Note: If the password contains special characters, enclose theentire string in single quotes (').

    false false

    Port Int32 Specifies the port on the server you want to use for theconnection.

    false false

    SaveCredentials SwitchParameter Indicates that you want to save the specified credentials in thelocal credential store.

    false false

    User String Specifies the user name you want to use for authenticating withthe server. If the Credential parameter is also specified, thisparameter is ignored. For more information about the serverauthentication logic of PowerCLI, run "helpabout_server_authentication".

    Note: If the user name contains special characters, enclose theentire string in single quotes (').

    false false

    WhatIf SwitchParameter Indicates that the cmdlet is run only to display the changes thatwould be made and actually no objects are modified.

    false false

    Return Type

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 11/287

    One or more CIServer objects

    Notes

    Examples

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

    Connect-CIServer -Server cloud.example.com -User Org1Admin -Password pass -Org Organization1

    Connects as an organization user to the provided organization.

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

    Connect-CIServer -Server cloud.example.com -User admin -Password pass

    Connects as a system administrator to a system organization.

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

    Connect-CIServer -Server cloud.example.com -Org Organization1 -Credential $vappUserCredential

    Connects to the provided organization by specifying a credential object.

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

    Connect-CIServer -Server cloud.example.com -SessionID $sessionID

    Connects to a server by providing a server session ID.

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

    Connect-CIServer -Menu

    Connects to a server from the list of recently connected servers.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Connect-VIServer

    Synopsis

    This cmdlet establishes a connection to a vCenter Server system.

    Syntax

    Connect-VIServer [-Server] [-Port ] [-Protocol ] [-Credential ] [-User ] [-Password ] [-Session ] [-NotDefault] [-SaveCredentials] [-AllLinked] [-Force] [] Connect-VIServer -Menu []

    Related Commands

    Online versionDisconnect-VIServer

    Detailed Description

    This cmdlet establishes a connection to a vCenter Server system. The cmdlet starts a new session or re-establishes a previous session with a vCenter Server systemusing the specified parameters.

    When you attempt to connect to a server, the server checks for valid certificates. To set the default behavior of vSphere PowerCLI when no valid certificates arerecognized, use the InvalidCertificateAction parameter of the Set-PowerCLIConfiguration cmdlet. For more information about invalid certificates, run 'Get-Helpabout_invalid_certificates'.

    You can have more than one connections to the same server. To disconnect from a server, you need to close all active connections to this server. vSphere PowerCLI supports working with multiple default servers. If you select this option, every time when you connect to a different server using Connect-VIServer,the new server connection is stored in an array variable together with the previously connected servers, unless the NotDefault parameter is set. This variable is named$DefaultVIServers and its initial value is an empty array. When you run a cmdlet and the target servers cannot be determined from the specified parameters, thecmdlet runs against all servers stored in the array variable. To remove a server from the $DefaultVIServers variable, you can either use Disconnect-Server to close allactive connections to the server, or modify the value of $DefaultVIServers manually.

    If you choose to work with a single default server, when you run a cmdlet and the target servers cannot be determined from the specified parameters, the cmdlet runsagainst the last connected server. This server is stored in the $defaultVIServer variable, which is updated every time you establish a new connection.

    To switch between single and multiple default servers working mode, use DefaultServerMode parameter of the Set-PowerCLIConfiguration cmdlet. Working withmultiple default servers will be enabled by default in a future release.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    Server String[] Specifies the IP address or the DNS name of the vSphere serverto which you want to connect. You can also specify a server byproviding its IPv6 address enclosed in square brackets, forexample [fe80::250:56ff:feb0:74bd%4].

    true false

    AllLinked SwitchParameter Indicates whether you want to connect to vCenter Server inlinked mode. If you specify $true for the AllLinked parameter andthe server to which you want to connect is a part of a federationvCenter Server, you'll be connected to all members of the linkedvCenter Server.

    To use this option, PowerCLI must be configured to work inmultiple servers connection mode. To configure PowerCLI tosupport multiple servers connection, specify Multiple for theDefaultVIServerMode parameter of the Set-PowerCLIConfiguration cmdlet.

    false false

    Credential PSCredential Specifies a PSCredential object that contains credentials forauthenticating with the server. For more information about theserver authentication logic of PowerCLI, run "helpabout_server_authentication". Passing values to this parameter

    false true (ByValue)

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 12/287

    through a pipeline is deprecated and will be disabled in a futurerelease.

    Force SwitchParameter Suppresses all user interface prompts during the cmdletexecution. Currently these include 'Multiple default servers' and'Invalid certificate action'.

    false false

    Menu SwitchParameter Indicates that you want to select a connection server from a listof recently connected servers. If Menu is set to $true, the cmdletretrieves a list of the last visited servers and enters a nestedcommand prompt, so that you can select a server from the list.

    true false

    NotDefault SwitchParameter Indicates that you do not want to include the server to whichyou connect into the $defaultVIServers variable.

    false false

    Password String Specifies the password you want to use for authenticating withthe server. If the Credential parameter is also specified, thisparameter is ignored. For more information about the serverauthentication logic of PowerCLI, run "helpabout_server_authentication".

    Note: If the password contains special characters, enclose theentire string in single quotes (').

    false false

    Port Int32 Specifies the port on the server you want to use for theconnection.

    false false

    Protocol String Specifies the internet protocol you want to use for theconnection. It can be either http or https.

    false false

    SaveCredentials SwitchParameter Indicates that you want to save the specified credentials in thelocal credential store.

    false false

    Session String Specifies the ID of an existing vCenter Server session you wantto reestablish.

    false false

    User String Specifies the user name you want to use for authenticating withthe server. If the Credential parameter is also specified, thisparameter is ignored. For more information about the serverauthentication logic of PowerCLI, run "helpabout_server_authentication". Passing values to this parameterthrough a pipeline is deprecated and will be disabled in a futurerelease.

    Note: If the user name contains special characters, enclose theentire string in single quotes (').

    false true (ByValue)

    Return Type

    VIServer

    Notes

    When you connect to a server via Connect-ViServer you allocate resources on this server, and these resources remain opened until Disconnect-ViServer - Force is calledon this connection. Closing the PowerCLI process does not c lose the server resources.

    Examples

    -------------- EXAMPLE 1 --------------

    Connect-VIServer -Server 10.23.112.235 -Protocol https -User admin -Password pass

    Connects to a vSphere server using the User and Password parameters.

    -------------- EXAMPLE 2 --------------

    Connect-VIServer Server -Credentials $myCredentialsObject -Port 1234

    Connects to a vSphere server by using a credential object.

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

    Connect-VIServer "Server" -SessionId $sessionId

    Connect by using a server session ID. Once you connect to a server, you can save the session ID - $serverObject.SessionId, so that you can restore the existing server connection instead ofreconnecting.

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

    Connect-VIServer Server

    Connect by using integrated authentication. In this case, the credentials you are logged on to your machine must be the same as those for the server.

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

    Connect-VIServer "Server" -User user -Password pass -SaveCredentials

    Connect to a server and save the credentials in the credential store. After the credentials are stored, you can connect to the server without specifying them. To geta previously saved credential store item, use the Get-VICredentialStoreItem cmdlet.

    -------------- Example 6 --------------

    Connect-VIServer -Menu

    Connect to a server by choosing the server address from a list of previously connected servers.

    -------------- Example 7 --------------

    Connect-VIServer "Server" -AllLinked

    Connect to a vSphere server which is a part of a federation vCenter Server. This will Connect you to all vSphere servers in the federation as well.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 13/287

    vSphere PowerCLI Reference

    Copy-DatastoreItem

    Synopsis

    This cmdlet copies items between datastores and between a datastore and a local file system provider.

    Syntax

    Copy-DatastoreItem [-Item] [[-Destination] ] [-Force] [-PassThru] [-Recurse] [-WhatIf] [-Confirm] []

    Related Commands

    Online version

    Detailed Description

    This cmdlet copies items between datastores and between a datastore and a local file system provider.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    Item Object[] Specifies the datastore item you want to copy. You can use a stringto provide a relative path to the item in the current provider location.

    true true (ByValue)

    Destination Object Specifies the destination where you want to copy the datastore item.You can use a string to specify a relative path to the destinationobject in the current provider location.

    false false .

    Confirm SwitchParameter If the value is $true, indicates that the cmdlet asks for confirmationbefore running. If the value is $false, the cmdlet runs without askingfor user confirmation.

    false false $true

    Force SwitchParameter Indicates whether to overwrite all items with the same name at theprovided destination.

    false false $false

    PassThru SwitchParameter Indicates that the cmdlet returns the copied item. false false $false

    Recurse SwitchParameter Indicates that you want to copy not only the item, but its childrenitems as well.

    false false $false

    WhatIf SwitchParameter Indicates that the cmdlet is run only to display the changes thatwould be made and actually no objects are modified.

    false false

    Return Type

    Zero or more FileInfo or DatastoreItem objects

    Notes

    Examples

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

    Copy-DatastoreItem vmstore:\Datacenter\Storage1\MyVM\* c:\VMFolder\MyVM\

    Copies the contents of a datastore folder in a local folder.

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

    Copy-DatastoreItem c:\VMFolder\MyVM\* vmstore:\Datacenter\Storage1\NewVM\ -Force

    Copies the contents of a local folder into a datastore folder. If the destination folder does not exist, the Force parameter enforces its creation.

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

    Copy-DatastoreItem c:\VMFolder\* vmstore:\Datacenter\Storage1\VMs\ -Force -Recurse

    Copies recursively the contents of a local folder into a datastore folder.

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

    Copy-DatastoreItem Windows.ISO vmstore:\Datacenter\Storage1\ISOFiles\WinXPSP3.iso

    Copies a file into a datastore folder and changes the file name.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Copy-DeployRule

    Synopsis

    Clones an existing rule.

    Syntax

    Copy-DeployRule [-DeployRule] [-Name ] [-AllHosts] [-ReplaceItem ] [-ReplacePattern ] [-NoUpdateRuleSet] [-NoActivate] []

    Related Commands

    New-DeployRuleGet-ESXImageProfileGet-ClusterGet-DatacenterGet-FolderGet-VMHostProfile

    Detailed Description

    Clones an existing rule. If you specify -Name, the new rule is assigned the specified name. Otherwise, the cmdlet assigns a new name to the original and gives theclone the name of the original rule.

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 14/287

    Use the -ReplaceItem and -ReplacePattern options to replace individual items or patterns from the old rule.

    If the old rule was in the working rule set, the cmdlet replaces it with the new rule unless you specify the -NoUpdateRuleSet option.

    You must have the "AutoDeploy.Rule.Create" privilege on the root folder of vCenter Server to use this cmdlet.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    DeployRule DeployRule Rule to copy. This parameter supports object-by-name, so youcan pass the name of the rule.

    true true (ByValue)

    AllHosts SwitchParameter If you specify AllHosts, the rule is applied to all hosts. false false

    Name String If -Name is specified, the cmdlet assigns the name to the newrule. Otherwise, the new rule keeps the old name and the oldname is renamed.

    false false

    NoActivate SwitchParameter If specified, the cmdlet changes the rule and adds it to theworking rule set, but does not activate the working rule set.

    false false

    NoUpdateRuleSet SwitchParameter If specified, the cmdlet changes the rule but does not add thechanged rule to the working and active rule set.

    false false

    ReplaceItem VIObjectCore[] Allows you to make a copy and change individual items, forexample the image profile the rule assigns. This parametersupports object-by-name, so you can pass the name of theitem.

    false false

    ReplacePattern String[] Allows you to make a copy and change individual patterns, forexample the set of hosts the rule applies to.

    false false

    Return Type

    VMware.DeployAutomation.Types.DeployRule

    Notes

    Examples

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

    C:\PS> Copy-DeployRule defimg -ReplaceItem "My New ESXi 5.0"

    Copies a rule previously retrieved with Get-DeployRule and replaces the image in that rule with the specified image.

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

    C:\PS> $img = Get-ESXImageProfile -Name "My New ESXi 5.0"

    C:\PS> Copy-DeployRule defimg -ReplaceItem $img

    Copies a rule previously retrieved with Get-DeployRule and replaces the image in that rule with the specified image.

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

    vSphere PowerCLI Reference

    Copy-HardDisk

    Synopsis

    Copies a virtual hard disk to another destination.

    Syntax

    Copy-HardDisk [-HardDisk] [-DestinationPath] [-DestinationStorageFormat ] [-Force] [-RunAsync] [-WhatIf] [-Confirm] []

    Related Commands

    Online versionGet-HardDiskNew-HardDiskRemove-HardDiskSet-HardDiskMove-HardDisk

    Detailed Description

    Copies a virtual hard disk to another destination specified by the DestinationPath parameter. DestinationPath must be a datastore path to the destination folder.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    DestinationPath String Specifies the datastore path to the folderwhere you want to copy the hard disk. Thedatastore name is included in the path insquare braces.

    true false

    HardDisk HardDisk[] Specifies the virtual hard disk you want tocopy.

    true true (ByValue)

    Confirm SwitchParameter If the value is $true, indicates that the cmdletasks for confirmation before running. If thevalue is $false, the cmdlet runs withoutasking for user confirmation.

    false false $true

    DestinationStorageFormat VirtualDiskStorageFormat Specifies the type of the hard disk copy. Thevalid values are Thin, Thick, Thick2GB, andEagerZeroedThick. This parameter is onlyapplicable when you are connected to anESX/ESXi host.

    false false

    Force SwitchParameter Indicates whether to overwrite all disks withthe same name at the provided destination.

    false false

    RunAsync SwitchParameter Indicates that the command returns false false

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 15/287

    immediately without waiting for the task tocomplete. In this mode, the output of thecmdlet is a Task object. For more informationabout the RunAsync parameter run "helpAbout_RunAsync" in the vSphere PowerCLIconsole.

    WhatIf SwitchParameter Indicates that the cmdlet is run only todisplay the changes that would be made andactually no objects are modified.

    false false

    Return Type

    The copied HardDisk object

    Notes

    Supported only on ESX 4.0 and later.

    Examples

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

    Get-HardDisk -VM $vm | Copy-HardDisk "[Storage1]/"

    Retrieves the hard disks of a virtual machine and copies them into the storage1 root folder.

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

    Copy-HardDisk -HardDisk $hdd -DestinationPath "[Storage1] vms/disks" -DestinationStorageFormat Thick

    Copies the $hdd hard disk to the "vms/disks"location on storage1 and changes the storage format of the destination disk to Thick.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Copy-VMGuestFile

    Synopsis

    This cmdlet copies files and folders from and to the guest OS of the specified virtual machines using VMware Tools.

    Syntax

    Copy-VMGuestFile [-Source] [-Destination] -LocalToGuest [-Force] [-VM] [-HostCredential ] [-HostUser ][-HostPassword ] [-GuestCredential ] [-GuestUser ] [-GuestPassword ] [-ToolsWaitSecs ] [-Server] [-WhatIf] [-Confirm] [] Copy-VMGuestFile [-Source] [-Destination] -GuestToLocal [-Force] [-VM] [-HostCredential ] [-HostUser ][-HostPassword ] [-GuestCredential ] [-GuestUser ] [-GuestPassword ] [-ToolsWaitSecs ] [-Server] [-WhatIf] [-Confirm] []

    Related Commands

    Online version

    Detailed Description

    This cmdlet copies files and folders from and to the guest OS of the specified virtual machines using VMware Tools. If a file with the same name exists in the destinationdirectory, it is overwritten. Use the GuestUser and GuestPassword, or GuestCredential parameters to authenticate when connecting to the VMware Tools. Toauthenticate with the host, use the HostUser and HostPassword, or HostCredential parameters. SSPI is not supported. This cmdlet supports only Windows XP 32 SP3,Windows Server 2003 32bit SP2, Windows Server 2003 64bit SP2, Windows 7 64 bit, Windows Server 2008 R2 64bit and Redhat Enterprise 5 operating systems.

    To run this cmdlet against vCenter Server/ESX/ESXi versions earlier than 5.0, you need to meet the following requirements: *You must run the cmdlet on the 32-bit version of Windows PowerShell. *You must have access to the ESX that hosts the virtual machine over TCP port 902. *For vCenter Server/ESX/ESXi versions earlier than 4.1, you need VirtualMachine.Interact.ConsoleInteract privilege. For vCenter Server/ESX/ESXi 4.1 and later, youneed VirtualMachine.Interact.GuestControl privilege.

    To run this cmdlet against vCenter Server/ESXi 5.0 and later, you need VirtualMachine.GuestOperations.Modify privilege.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    Source String[] Specifies the file you want to copy. If the file is on a virtualmachine, specifies the absolute file path. Relative file pathsare supported only when copying files from a local storage.Wildcards are allowed only at the end of the source path. Ifyou are copying files from the guest operating system of avirtual machine to a local directory, the Source parametersupports wildcards only on vCenter Server 5.0 and later.

    true true(ByPropertyName)

    Destination String Specifies the destination path where you want to copy thefile. If the destination points to a virtual machine, specify theabsolute file path. Relative destination paths are supportedonly when copying files to a local storage.

    true false

    VM VirtualMachine[] Specifies the virtual machine where the file is located. true true (ByValue)

    Confirm SwitchParameter If the value is $true, indicates that the cmdlet asks forconfirmation before running. If the value is $false, the cmdletruns without asking for user confirmation.

    false false $true

    Force SwitchParameter Indicates that the non-existing directories in the specifieddestination path are automatically created.

    false false

    GuestCredential PSCredential Specifies a PSCredential object that contains credentials forauthenticating with the guest OS where the file to be copiedis located.

    false false

    GuestPassword SecureString Specifies the password you want to use for authenticatingwith the guest OS where the file to be copied is located.

    false false

    GuestToLocal SwitchParameter Indicates that you want to copy a file from the guestoperating system of the virtual machine to a local directory.

    true false

    GuestUser String Specifies the user name you want to use for authenticatingwith the guest OS where the file to be copied is located.

    false false

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 16/287

    HostCredential PSCredential Specifies a PSCredential object that contains credentials forauthenticating with the host where the file is to be copied. Donot use this parameter if the HostUser and HostPasswordparameters are used. You need to specify host credentialsonly if the version of the vCenter Server or ESX you areauthenticating with is earlier than 4.0, or the VIX version youhave installed is earlier than 1.10.

    false false

    HostPassword SecureString Specifies the password you want to use for authenticatingwith the host where the file is to be copied. You need tospecify host credentials only if the version of the vCenterServer or ESX you are authenticating with is earlier than 4.0,or the VIX version you have installed is earlier than 1.10.

    false false

    HostUser String Specifies the user name you want to use for authenticatingwith the host where the file is to be copied. You need tospecify host credentials only if the version of the vCenterServer or ESX you are authenticating with is earlier than 4.0,or the VIX version you have installed is earlier than 1.10.

    false false

    LocalToGuest SwitchParameter Indicates that you want to copy a file from a local directory tothe guest operating system of the virtual machine.

    true false $true

    Server VIServer[] Specifies the vCenter Server instances on which you want torun the cmdlet. If no value is passed to this parameter, thecommand runs on the default servers. For more informationabout default servers, see the description of Connect-VIServer.

    false false

    ToolsWaitSecs Int32 Specifies the time in seconds to wait for a response from theVMware Tools. If a non-positive value is provided, the systemwaits infinitely long time.

    false false 20

    WhatIf SwitchParameter Indicates that the cmdlet is run only to display the changesthat would be made and actually no objects are modified.

    false false

    Return Type

    None

    Notes

    Examples

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

    Copy-VMGuestFile -Source c:\text.txt -Destination c:\temp\ -VM VM -GuestToLocal -GuestUser user -GuestPassword pass2

    Copies the text.txt file from the guest OS system to the local Temp directory.

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

    $vm = Get-VM -Name VM

    Get-Item "c:\FolderToCopy\*.*" | Copy-VMGuestFile -Destination "c:\MyFolder" -VM $vm -LocalToGuest -GuestUser -GuestPassword pass2

    Copies files from a local machine to a guest operating system.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Disconnect-CIServer

    Synopsis

    This cmdlet disconnects the session from the specified cloud servers.

    Syntax

    Disconnect-CIServer [[-Server] ] [-Force] [-WhatIf] [-Confirm] []

    Related Commands

    Online versionConnect-CIServer

    Detailed Description

    This cmdlet disconnects the session from the specified cloud servers. If no servers are provided to the Server parameter, the cmdlet disconnects the default servers.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    Server CIServer[] Specifies the cloud servers you want to disconnect from. false true (ByValue)

    Confirm SwitchParameter If the value is $true, indicates that the cmdlet asks for confirmationbefore running. If the value is $false, the cmdlet runs without asking foruser confirmation.

    false false

    Force SwitchParameter Specifies that you want to remove all existing connections to thespecified servers.

    false false

    WhatIf SwitchParameter Indicates that the cmdlet is run only to display the changes that wouldbe made and actually no objects are modified.

    false false

    Return Type

    None

    Notes

    Examples

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

    Disconnect-CIServer

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 17/287

    Disconnects all default servers.

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

    Disconnect-CIServer * -Confirm:$false

    Disconnects all default servers without asking for confirmation.

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

    Disconnect-CIServer $server1 -Force -Confirm:$false

    Disconnects all server connections stored in $server1.

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

    $server1,$server2 | Disconnect-CIServer -Force -Confirm:$false

    Disconnects all server connections stored in the $server1 and $server2 variables.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Disconnect-VIServer

    Synopsis

    This cmdlet closes the connection to a vCenter Server system.

    Syntax

    Disconnect-VIServer [[-Server] ] [-Force] [-WhatIf] [-Confirm] []

    Related Commands

    Online versionConnect-VIServer

    Detailed Description

    This cmdlet closes the connection to a vCenter Server system. In PowerCLI, you can have multiple connections to a server. In order to disconnect from a server, youmust close all active connections to it. By default, Disconnect-VIServer closes only the last connection to the specified server. To close all active connections to a server,use the Force parameter or run the cmdlet for each connection. When a server is disconnected, it is removed from the default servers list. For more information aboutdefault servers, see the description of Connect-VIServer.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    Server VIServer[] Specifies the vCenter Server systems you want to disconnect from. false true (ByValue)

    Confirm SwitchParameter If the value is $true, indicates that the cmdlet asks for confirmationbefore running. If the value is $false, the cmdlet runs without asking foruser confirmation.

    false false $true

    Force SwitchParameter Indicates that you want to close all active connections to the specifiedserver and disconnect from it. If the value is $false, the cmdlet closesonly the last connection to the specified server and you must runDisconnect-VIServer for each active connection to this server in order todisconnect from it.

    false false

    WhatIf SwitchParameter Indicates that the cmdlet is run only to display the changes that wouldbe made and actually no objects are modified.

    false false

    Return Type

    None

    Notes

    Examples

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

    $Server = Connect-VIServer 10.23.112.235

    Disconnect-VIServer -Server $Server

    Connects to a server with an IP address 10.23.112.235 and saves the returned VIServer object in the $Server variable. Then disconnects from the specified server.

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

    Disconnect-VIServer -Server $global:DefaultVIServers -Force

    Closes all connections to the default servers.

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

    Disconnect-VIServer -Server * -Force

    Disconnects all server connections.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Dismount-Tools

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 18/287

    Synopsis

    This cmdlet dismounts the VMware Tools installer CD.

    Syntax

    Dismount-Tools [[-Guest] ] [] Dismount-Tools [[-VM] ] [[-Server] ] []

    Related Commands

    Online versionUpdate-ToolsMount-Tools

    Detailed Description

    This cmdlet dismounts the VMware Tools installer CD from one or more virtual machines operating systems specified by the VM and Guest parameters. To specify aserver different from the default one, use the Server parameter. The virtual machines must be powered on.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    Guest VMGuest[] Specifies the guest operating systems from which you want to remove theVMware Tools.

    false true (ByValue)

    VM VirtualMachine[] Specifies the virtual machines from which you want to remove the VMwareTools.

    false true (ByValue)

    Server VIServer[] Specifies the vCenter Server instances on which the search for virtualmachine names passed by the VM parameter is performed. If no value isgiven to this parameter, the search for the virtual machine names isperformed on the default server.

    false false

    Return Type

    None

    Notes

    Examples

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

    Dismount-Tools VM

    Dismounts the VMware Tools from the VM virtual machine. The virtual machine must be powered on.

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

    Get-VMGuest VM | Dismount-Tools

    Dismounts the VMware Tools from the virtual machine specified by its guest operating system. The virtual machine must be powered on.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Export-EsxImageProfile

    Synopsis

    Syntax

    Export-EsxImageProfile [-ImageProfile] [-FilePath] -ExportToIso [-Force] [-NoSignatureCheck] [-RunAsync] [-WarningAction] [-WarningVariable ] [] Export-EsxImageProfile [-ImageProfile] [-FilePath] -ExportToBundle [-Force] [-NoSignatureCheck] [-RunAsync] [-WarningAction] [-WarningVariable ] []

    Related Commands

    Detailed Description

    Exports an Image Profile object as either an ESXi ISO image that can be booted up and used as an ESXi installer, or an offline depot ZIP file that contains metadataplus the VIB packages. In both cases, downloads the VIB binaries and validates the VIB signatures.

    You can perform the following tasks with the offline depot ZIP file:

    *Import the ZIP into VMware Update Manager for patch remediation *Download the ZIP to an ESXi host and used with esxcli for installation *Re-import the ZIP into ImageBuilder itself using Add-EsxSoftwareDepot

    You can specify either -ExportToIso or -ExportToBundle but not both.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    ImageProfile ImageProfile (pipeline input, prompt) Specifies the image profile toexport.

    Takes one of the following forms:

    *Name of an image profile, as displayed in the Name columnof Get-EsxImageProfile, or the Name property of anyImageProfile object

    *ImageProfile object

    true true (ByValue,ByPropertyName)

    FilePath String Required; specifies the destination for the ISO or the ZIPfile path. Include the extension, either .iso or .zip. Offlinedepots must be named with .zip at the end. If the filealready exists, it will not be overwritten unless -Force isspecified.

    true false

    ExportToBundle SwitchParameter true false

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 19/287

    ExportToIso SwitchParameter true false

    Force SwitchParameter Optional. If specified, the cmdlet overwrites an existingdestination file with the same name.

    false false

    NoSignatureCheck SwitchParameter Optional. If specified, disables VIB signature validation. Theuse of this option may lead to debilitating securityvulnerabilities.

    false false

    RunAsync SwitchParameter false false

    WarningAction ActionPreference false false

    WarningVariable String false false

    Return Type

    Notes

    Examples

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

    Export-EsxImageProfile -ImageProfile "Evan's Profile" -ExportToIso -FilePath c:\isos\evans-iso.iso

    Export an ISO image

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

    New-EsxImageProfile -CloneProfile "ESXi-5.0.0-234567-standard" -Name "Evan's Profile"

    Add-EsxSoftwarePackage -ImageProfile "Evan's Profile" -SoftwarePackage cisco-vem-v140

    Export-EsxImageProfile -ImageProfile "Evan's Profile" -ExportToBundle -FilePath c:\isos\base-plus-vem.zip

    Clone an image profile, add a software package, then export to offline bundle.

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

    vSphere PowerCLI Reference

    Export-VApp

    Synopsis

    This cmdlet exports a vApp or a single virtual machine to the specified destination.

    Syntax

    Export-VApp [[-Destination] ] [-VApp] [-Name ] [-Force] [-Format ] [-CreateSeparateFolder] [-Description ] [-Server ] [-RunAsync] [-WhatIf] [-Confirm] [] Export-VApp [[-Destination] ] -VM [-Name ] [-Force] [-Format ] [-CreateSeparateFolder] [-Description] [-Server ] [-RunAsync] [-WhatIf] [-Confirm] []

    Related Commands

    Online versionGet-VAppImport-VAppNew-VAppRemove-VAppSet-VAppStart-VAppStop-VAppMove-VApp

    Detailed Description

    This cmdlet exports a vApp or a single virtual machine to the specified destination. If no destination is specified, the cmdlet creates a new folder in the current workingdirectory and exports the vApp or the virtual machine to it. The name of the new folder is the same as the name of the vApp or the virtual machine as it appears invCenter Server.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    Destination String Specifies a destination path to the file system locationwhere you want to export the vApp or the virtualmachine. If the value of the Destination parameter is afolder, the vApp or the virtual machine is exported to acontainer folder (OVF). If the destination is a file, thevApp or the virtual machine is exported in OVA format.

    false false

    VApp VApp[] Specifies the vApp that you want to export. true true (ByValue)

    Confirm SwitchParameter If the value is $true, indicates that the cmdlet asks forconfirmation before running. If the value is $false, thecmdlet runs without asking for user confirmation.

    false false $true

    CreateSeparateFolder SwitchParameter Indicates that you want to create a separate folder foreach vApp or virtual machine.

    false false

    Description String Provides a description of the exported vApp or virtualmachine.

    false false

    Force SwitchParameter Indicates that the cmdlet overwrites the existingdestination files and creates directories to complete thespecified file path.

    false false

    Format VAppStorageFormat Specifies the file format of the specified vApp or virtualmachine. The default format is OVF. The valid valuesare OVF and OVA.

    false false

    Name String Specifies a name for the exported vApp or virtualmachine.

    false false

    RunAsync SwitchParameter Indicates that the command returns immediatelywithout waiting for the task to complete. In this mode,the output of the cmdlet is a Task object. For moreinformation about the RunAsync parameter run "helpAbout_RunAsync" in the vSphere PowerCLI console.

    false false

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 20/287

    Server VIServer[] Specifies the vCenter Server instances on which youwant to run the cmdlet. If no value is passed to thisparameter, the command runs on the default servers.For more information about default servers, see thedescription of Connect-VIServer.

    false false

    VM VirtualMachine[] Specifies the virtual machine that you want to export. true true (ByValue)

    WhatIf SwitchParameter Indicates that the cmdlet is run only to display thechanges that would be made and actually no objectsare modified.

    false false

    Return Type

    Zero or more FileInfo objects

    Notes

    Examples

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

    Get-VApp -Name "MyVApp*" | Export-VApp -Destination "C:\vapps\"

    Retrieves all vApps whose names start with "MyVApp" and exports them to the specified path.

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

    $myVApp = Get-VApp -Name "MyVApp1" Export-VApp -Destination "C:\NewFolder\" -VApp $myVApp -Name "EMail_vApp" -Force

    Exports the vApp in the $myVApp variable to the specified location and assigns a name to the folder.

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

    $myVApp = Get-VApp -Name "MyVApp1"

    Export-VApp -vApp $myVApp -Destination "C:\vapps\Vapp\" -Force -CreateSeparateFolder:$false

    Exports the vApp in the $myVApp variable to the specified location without creating a separate folder for each virtual appliance.

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

    $myVApp = Get-VApp -Name "MyVApp1"

    Export-VApp -vApp $myVApp -Destination "C:\vapps\myVapp\" -Format Ova

    Exports a vApp in OVA format.

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

    Get-VM -Name MyVM* | Export-VApp -Destination "C:\MyVMs\"

    Retrieves all virtual machines whose names start with "MyVM" and exports them to the specified path.

    -------------- Example 6 --------------

    $myVM = New-VM -Name MyVM1 -VMHost MyVMHost1

    Export-VApp -Destination "C:\MyVMs\" -VM $myVM -Format Ova

    Creates a new virtual machine and exports it in OVA format.

    -------------- Example 7 --------------

    $myVM = New-VM -Name "MyVM1" -VMHost MyVMHost1

    Get-VM -Name MyVM | Export-VApp -Destination "C:\MyVMs\"

    Export-VApp -Destination "C:\MyVMs\" -VM $myVM -Force

    Exports a virtual machine to the same path twice. The second time forces an override of the previously exported files.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Export-VDPortGroup

    Synopsis

    This cmdlet exports the configuration of a specified distributed port group to a specified .zip file.

    Syntax

    Export-VDPortGroup [-VDPortGroup] [-Description ] [-Destination ] [-Force] [-Server ] []

    Related Commands

    Online versionGet-VDPortgroupNew-VDPortgroupRemove-VDPortgroupSet-VDPortgroup

    Detailed Description

    This cmdlet exports the configuration of a specified distributed port group to a specified .zip file. You can export only vSphere distributed port groups.

    Note: This cmdlet is supported only on vSphere 5.1 or later.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    VDPortGroup VDPortgroup[] Specifies the distributed port group whose configurationyou want to export.

    true true (ByValue)

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 21/287

    Description String Specifies a description for the exported distributed portgroup configuration.

    false false

    Destination String Specifies an absolute or a relative file path to the locationwhere you want to export the configuration of thedistributed port group.

    false false [file system providerlocation]\[port groupname]-[timestamp].backup.zip

    Force SwitchParameter Indicates that if the specified destination file already exists,the existing file will be overwritten. Any directories requiredto complete the specified file path will also be created.

    false false

    Server VIServer[] Specifies the vCenter Server systems on which you want torun the cmdlet. If no value is given to this parameter, thecommand runs on the default servers. For more informationabout default servers, see the description of Connect-VIServer.

    false false

    Return Type

    One FileInfo object that contains information about the exported .zip file

    Notes

    Examples

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

    Get-VDPortGroup -Name 'MyVDPortGroup' | Export-VDPortGroup -Destination 'C:\MyVDSwitchesBackup\MyVDPortGroup_21122012.zip'

    Exports the configuration of the specified port group to the specified file.

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

    $myPortGroup = Get-VDPortGroup -Name 'MyVDPortGroup'

    Export-VDPortGroup -VDPortGroup $myPortGroup -Destination 'C:\MyVDSwitchesBackup\MyVDPortGroupBackup.zip' -Force

    Exports the configuration of the specified port group to the specified file. If the MyVDSwitchesBackup directory does not exist, it is created. If theMyVDPortGroupBackup.zip file already exists in the specified location, it is overwritten.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Export-VDSwitch

    Synopsis

    This cmdlet exports the configuration of a specified vSphere distributed switch to a .zip file.

    Syntax

    Export-VDSwitch [-VDSwitch] [-WithoutPortGroups] [-Description ] [-Destination ] [-Force] [-Server ][]

    Related Commands

    Online versionGet-VDSwitchNew-VDSwitchRemove-VDSwitchSet-VDSwitch

    Detailed Description

    This cmdlet exports the configuration of a specified vSphere distributed switch to a .zip file.

    Note: This cmdlet is supported only on vCenter Server 5.1 or later.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    VDSwitch VDSwitch[] Specifies the vSphere distributed switch whoseconfiguration you want to export.

    true true (ByValue)

    Description String Specifies a description for the exported vSpheredistributed switch configuration.

    false false

    Destination String Specifies an absolute or a relative file path to thelocation where you want to export the vSpheredistributed switch configuration.

    false false [file system providerlocation]\[port groupname]-[timestamp].backup.zip

    Force SwitchParameter Indicates that if the specified destination file alreadyexists, the existing file is overwritten. Any directoriesrequired to complete the specified file path are alsocreated.

    false false

    Server VIServer[] Specifies the vCenter Server systems on which youwant to run the cmdlet. If no value is given to thisparameter, the command runs on the defaultservers. For more information about default servers,see the description of Connect-VIServer.

    false false

    WithoutPortGroups SwitchParameter Indicates that the configuration of the vSpheredistributed switch is exported without its port groupconfiguration.

    false false

    Return Type

    One FileInfo object that contains information about the exported .zip file

    Notes

    Examples

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

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 22/287

    Get-VDSwitch -Name 'MyVDSwitch' | Export-VDSwitch -Description "My VDSwitch configuration" -Location "c:\myVDSwitchConfig.zip"

    Exports the configuration of the specified vSphere distributed switch and its port groups to the specified file.

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

    Get-VDSwitch -Name 'MyVDSwitch' | Export-VDSwitch -Description "My VDSwitch configuration" -Location "c:\myVDSwitchConfig.zip" -WithoutPortGroups -Force

    Exports the configuration of the specified vSphere distributed switch and its port groups to the specified file. If the myVDSwitchConfig.zip file already exists, it isoverwritten.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Export-VMHostProfile

    Synopsis

    This cmdlet exports the specified host profile to a file.

    Syntax

    Export-VMHostProfile [-FilePath] [-Profile] [-Force] [-Server ] []

    Related Commands

    Online versionApply-VMHostProfileGet-VMHostProfileImport-VMHostProfileRemove-VMHostProfileSet-VMHostProfileTest-VMHostProfileComplianceNew-VMHostProfile

    Detailed Description

    This cmdlet exports the specified host profile to a file that is in the VMware profile format (.vpf). If the value of the Force parameter is $false and the destination fileexists or the target parent directory does not exist, a terminating error is generated. If the value of the Force parameter is $true, the existing destination file isoverwritten and directories are created to complete the specified file path.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    FilePath String Specifies the path to the file where you want to export the host profile. true false

    Profile VMHostProfile Specifies the host profile you want to export. true true (ByValue)

    Force SwitchParameter Indicates that the cmdlet overwrites the existing destination files andcreates directories to complete the specified file path.

    false false

    Server VIServer Specifies the vCenter Server instances on which you want to run thecmdlet. If no value is passed to this parameter, the command runs onthe default servers. For more information about default servers, see thedescription of Connect-VIServer.

    false false

    Return Type

    Zero or more FileInfo objects

    Notes

    Examples

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

    $profile = (Get-VMHostProfile -Name Profile )[0]

    Export-VMHostProfile -FilePath export.prf -Profile $profile -Force

    Exports the selected host profile to the export.prf file.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Format-VMHostDiskPartition

    Synopsis

    This cmdlet formats a new VMFS (Virtual Machine File System) on each of the specified host disk partitions.

    Syntax

    Format-VMHostDiskPartition [-VolumeName] -VMHostDiskPartition [-WhatIf] [-Confirm] []

    Related Commands

    Online versionGet-VMHostDiskPartition

    Detailed Description

    This cmdlet formats a new VMFS (Virtual Machine File System) on each of the specified host disk partitions.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    VolumeName String Specifies a name for the new VMFS. true false

    Confirm SwitchParameter If the value is $true, indicates that the cmdlet asks forconfirmation before running. If the value is $false, the

    false false

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 23/287

    cmdlet runs without asking for user confirmation.

    VMHostDiskPartition VMHostDiskPartition[] Specifies the disk partitions on which you want toformat a new VMFS.

    true true (ByValue)

    WhatIf SwitchParameter Indicates that the cmdlet is run only to display thechanges that would be made and actually no objectsare modified.

    false false

    Return Type

    Zero or more formatted VMHostDiskPartition objects

    Notes

    Examples

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

    Get-VMHost Host | Get-VMHostDisk | Get-VMHostDiskPartition | ? {.Type -eq "Ntfs"} | Format-VMHostDiskPartition -VolumeName "NewStorage"

    Formats the NTFS disk partitions of a host.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Get-AdvancedSetting

    Synopsis

    This cmdlet retrieves the advanced settings for the specified entity.

    Syntax

    Get-AdvancedSetting [-Entity] [[-Name] ] [-Server ] []

    Related Commands

    Online versionNew-AdvancedSettingRemove-AdvancedSettingSet-AdvancedSetting

    Detailed Description

    This cmdlet retrieves the advanced settings for the specified entity.

    Parameters

    NAME TYPE DESCRIPTION REQUIRED? PIPELINE INPUT DEFAULT VALUE

    Name String[] Specifies the names of the advanced settings you want to retrieve. false false

    Entity VIObject[] Specifies the entities for which you want to retrieve the advanced settings. Thisparameter accepts VIServer, VirtualMachine, VMHost, DatastoreCluster, andCluster objects.

    true true (ByValue)

    Server VIServer[] Specifies the vCenter Server instances on which you want to run the cmdlet. If novalue is passed to this parameter, the command runs on the default servers. Formore information about default servers, see the description of Connect-VIServer.

    false false

    Return Type

    Zero or more AdvancedSetting objects

    Notes

    Examples

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

    Get-AdvancedSetting -Entity (Get-Cluster -Name Cluster)

    Retrieves the advanced settings of the cluster named Cluster.

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

    Get-AdvancedSetting -Entity (Get-Cluster -Name Cluster) -Name SettingName

    Retrieves the advanced setting named SettingName of the Cluster cluster.

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

    Get-AdvancedSetting -Entity Server -Name '*smtp*'

    Retrieve all smtp settings for the specified server.

    Copyright 1998 - 2013 VMware, Inc. All rights reserved.

    vSphere PowerCLI Reference

    Get-AlarmAction

    Synopsis

    This cmdlet retrieves the actions of the specified alarm definitions.

    Syntax

    Get-AlarmAction [[-AlarmDefinition] ] [-ActionType ] [-Server ] []

  • 7/8/13 Add-CIDatastore - vCloud Snapin Cmdlets Reference

    pubs.vmware.com/vsphere-51/advanced/print.jsp?topic=/../nav/6_2_1_0 24/287