Get-HCXVM

This cmdlet retrieves a list of virtual machines. You can create new HCX migration and replication requests by using the output of the cmdlet.

Syntax

[-Container  <HCXContainer[]>]
[-Limit  <Int32>]
[-Name  <String[]>]
[-Offset  <Int32>]
[-PowerState  <PowerState>]
[-Server  <HcxServer[]>]
[-Site  <HCXSite[]>]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
optional
Container
HCXContainer[] named Specifies the HCX container for which you want to list the virtual machines.
optional
Limit
Int32 named Specifies the maximum number of Virtual Machines to be retrieved. Max of Limit or 500 will be used if the Limit and Offset both are set to integer greater than 0
optional
Name
String[] named
  • wildcards
  • Specifies the name of the HCX virtual machine.
    optional
    Offset
    Int32 named Specifies the pagination parameter. Offset and Limit both has to be set to an integer greater than 0 and used together.
    optional
    PowerState
    PowerState named Indicates the virtual machine power state. The valid values are PoweredOn and PoweredOff.
    optional
    Server
    HcxServer[] named
  • wildcards
  • Specifies the HCX Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-HCXServer cmdlet.
    optional
    Site
    HCXSite[] named
  • pipeline
  • Specifies the HCX site for which you want to list the virtual machines. If this parameter is not specified, the default one is selected from the source site.

    -Uid  <String[]>
    [-Server  <HcxServer[]>]
    [CommonParameters]

    Parameters

    Required Parameter Name Type Position Features Description
    required
    Uid
    String[] named Specifies the Uid of the HCX virtual machine. Note: When a list of values is specified for the Uid parameter, the returned objects have a Uid that matches exactly one of the string values in the list.
    optional
    Server
    HcxServer[] named
  • wildcards
  • Specifies the HCX Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of the Connect-HCXServer cmdlet.

    Output

    VMware.VimAutomation.Hcx.Types.V1.HCXVM

    Examples


    Example 1

    Get-HCXVM

    Retrieves a list of the HCX virtual machines from the source site.

    Example 2

    $myDestination = Get-HCXSite -Destination -Name "myDestinationName"
    Get-HCXVM -Site $myDestination

    Retrieves a list of the HCX virtual machines from the destination site.

    Example 3

    Get-HCXVM -Name "myVmName"

    Retrieves a list of the HCX virtual machines filtered by name.

    Example 4

    Get-HCXVM -PowerState PoweredOn

    Retrieves a list of the HCX virtual machines filtered by the power state.

    Example 5

    $myVm = Get-HCXVM -Name "myVmName"
    Get-HCXVM -Uid $myVm.Uid

    Retrieves a list of the HCX virtual machines by Uid.

    Example 6

    $container = Get-HCXContainer -Name "myContainerName"
    Get-HCXVM -Container $container

    Retrieves a list of the HCX virtual machines filtered by the hcx container.

    Example 7

    PS C:\> Get-HCXVM -Offset 10 -Limit 100

    Retrieves a list of the HCX Virtual Machines using pagination

    Example 8

    PS C:\> Get-HCXVM -Name "MyVM-Name1","MyVM-Name2","MyVM-Name3"

    Retrieves a list of the HCX Virtual Machines filtered by names

    Related Commands

    Feedback

    Was this page helpful?