Syntax
Get-HCXVM [[-Name] <String[]>] [-Server <HcxServer[]>] [-Site <HCXSite[]>] [-PowerState <PowerState>] [-Container <HCXContainer[]>] [<CommonParameters>]Related Commands
Detailed Description
This cmdlet retrieves a list of virtual machines. You can create new HCX migration and replication requests by using the output of the cmdlet.Parameters
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name | String[] | Specifies the name of the HCX virtual machine. | false | False | |
Container | HCXContainer[] | Specifies the HCX container for which you want to list the virtual machines. | false | False | |
PowerState | PowerState | Indicates the virtual machine power state. The valid values are PoweredOn and PoweredOff. | false | False | |
Server | HcxServer[] | Specifies the HCX Server systems 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 the Connect-HCXServer cmdlet. | false | False | |
Site | HCXSite[] | 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. | false | True (ByValue) | |
Uid | String[] | 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. | true | False |
Return Type
VMware.VimAutomation.Hcx.Types.V1.HCXVMNotes
Examples
-------------------------- Example 1 --------------------------
PS C:\> Get-HCXVM
Retrieves a list of the HCX virtual machines from the source site.
-------------------------- Example 2 --------------------------
PS C:\> $myDestination = Get-HCXSite -Destination -Name "myDestinationName" Get-HCXVM -Site $myDestination
Retrieves a list of the HCX virtual machines from the destination site.
-------------------------- Example 3 --------------------------
PS C:\> Get-HCXVM -Name "myVmName"
Retrieves a list of the HCX virtual machines filtered by name.
-------------------------- Example 4 --------------------------
PS C:\> Get-HCXVM -PowerState PoweredOn
Retrieves a list of the HCX virtual machines filtered by the power state.
-------------------------- Example 5 --------------------------
PS C:\> $myVm = Get-HCXVM -Name "myVmName" Get-HCXVM -Uid $myVm.Uid
Retrieves a list of the HCX virtual machines by Uid.
-------------------------- Example 6 --------------------------
PS C:\> $container = Get-HCXContainer -Name "myContainerName" Get-HCXVM -Container $container
Retrieves a list of the HCX virtual machines filtered by the hcx container.