PowerCLI Reference

Get-CIVM

Synopsis

This cmdlet retrieves virtual machines in the cloud.

Syntax

Get-CIVM [[-Name] <String[]>] [-Org <Org[]>] [-OrgVdcNetwork <OrgNetworkBase[]>] [-OrgVdc <OrgVdc[]>] [-VApp <CIVApp[]>] [-Status <CIVAppStatus[]>] [-Server <CIServer[]>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [<CommonParameters>]

Get-CIVM -Id <String[]> [-Server <CIServer[]>] [-InformationAction <ActionPreference>] [-InformationVariable <String>] [-PipelineVariable <String>] [<CommonParameters>]

Related Commands

Online version
Start-CIVM
Stop-CIVM
Suspend-CIVM
Start-CIVMGuest
Stop-CIVMGuest

Detailed Description

This cmdlet retrieves virtual machines in the cloud and filters them by the provided parameters.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
NameString[]Specifies the name of the cloud virtual machines you want to retrieve.falsefalse
IdString[]Specifies the IDs of the cloud virtual machines you want to retrieve.

Note: When a list of values is specified for the Id parameter, the returned objects would have an ID that matches exactly one of the string values in that list.
truefalse
InformationActionActionPreferencefalsefalse
InformationVariableStringfalsefalse
OrgOrg[]Specifies from which organizations you want to retrieve virtual machines.falsetrue (ByValue)
OrgVdcOrgVdc[]Specifies the organization vDCs for which you want to retrieve virtual machines.falsetrue (ByValue)
OrgVdcNetworkOrgNetworkBase[]Specifies the organization vDC networks to which the virtual machines are connected.falsetrue (ByValue)
PipelineVariableStringfalsefalse
ServerCIServer[]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.falsefalse
StatusCIVAppStatus[]Specifies the status of the virtual machines you want to retrieve.falsefalse
VAppCIVApp[]Specifies the vApps to which the virtual machines you want to retrieve belong.falsetrue (ByValue)

Return Type

Zero or more CIVM objects

Notes

Examples

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

Get-CIVM

Gets all visible virtual machines for the current user.

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

Get-CIVM -Name "MyVM"

Gets a single virtual machine by its name.

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

Get-CIVApp -Name "*DB*"

Gets all virtual machines that match a defined string by name.

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

Get-CIVM -ID $myVMId

Gets a virtual machine with a given ID.

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

Get-CIVM -Org "MyOrganization"

Gets all visible virtual machines within an organization.

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

Get-CIVM -OrgNetwork "OrgNetwork1"

Gets all visible virtual machines within an organization network.

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

Get-OrgNetwork -Name "OrgNetwork1" | Get-CIVM

Gets all visible virtual machines within an organization network (pipeline).

-------------- Example 8 --------------

Get-CIVM -OrgVdc "MyOrgVDC1"

Gets all visible virtual machines within an organization's virtual datacenter.

-------------- Example 9 --------------

Get-OrgVdc -Name "OrgVdc1" | Get-CIVM

Get all visible virtual machines within an organization's virtual datacenter by using a pipeline syntax.

-------------- Example 10 --------------

Get-CIVM -VApp "MyVApp"

Gets virtual machines running a particular VApp.

-------------- Example 11 --------------

Get-CIVApp "MyVApp" | Get-CIVM

Gets virtual machines running a particular VApp (pipeline).

-------------- Example 12 --------------

Get-CIVM -Status "PoweredOn", "Suspended"

Gets virtual machines by status (all powered on and suspended VMs).


Copyright © VMware, Inc. All rights reserved.