Get-VM: Difference between revisions

From VI-Toolkit
Jump to navigation Jump to search
New page: NAME Get-VM SYNOPSIS Gets from a VMware Infrastructure server one or more virtual machines. SYNTAX Get-VM [-Datastore <Datastore[]>] [-Location <VIContainer[]>] [[-Na...
 
m applied a bit of formatting, added categories
 
Line 1: Line 1:
NAME
=====NAME=====
     Get-VM
     Get-VM
      
      
Line 11: Line 11:
      
      
      
      
DETAILED DESCRIPTION
=====DETAILED DESCRIPTION=====
    Gets from a VMware Infrastructure server one or more objects that represent
Gets from a VMware Infrastructure server one or more objects that represent virtual machines. Returns a set of virtual machines that correspond to the filter criteria provided by the cmdlet parameters. For virtual machines with multiple NICs and therefore multiple IP addresses, the "IPAddress" property of the VMGuest object contains all IP addresses of the virtual machine.
    virtual machines. Returns a set of virtual machines that correspond to the
 
    filter criteria provided by the cmdlet parameters. For virtual machines wi
The IP at position 0 is the primary IP address.
    th multiple NICs and therefore multiple IP addresses, the "IPAddress" prope
    rty of the VMGuest object contains all IP addresses of the virtual machine.
    The IP at position 0 is the primary IP address.
      
      


PARAMETERS
PARAMETERS
     -Datastore <Datastore[]>
     -Datastore <Datastore[]>
         Gets the virtual machines associated with one or more of the specified  
         Gets the virtual machines associated with one or more of the specified datastores.
         datastores. Passing values to this parameter through a pipeline is depr
         Passing values to this parameter through a pipeline is deprecated
         ecated and will be removed in one of the following releases.
         and will be removed in one of the following releases.
          
          
         Required?                    false
         Required?                    false
Line 33: Line 30:
          
          
     -Location <VIContainer[]>
     -Location <VIContainer[]>
         Specifies one or more virtual infrastructure container objects (e.g. fo
         Specifies one or more virtual infrastructure container objects (e.g. folders,
         lders, datacenters, clusters) to search for virtual machines.
         datacenters, clusters) to search for virtual machines.
          
          
         Required?                    false
         Required?                    false
Line 53: Line 50:
          
          
     -Id <String[]>
     -Id <String[]>
         Specifies one or more virtual machine hosts by ID. Use commas to separa
         Specifies one or more virtual machine hosts by ID. Use commas to separate
         te multiple IDs.
         multiple IDs.
          
          
         Required?                    false
         Required?                    false
Line 63: Line 60:
          
          
     -NoRecursion
     -NoRecursion
         Get-VM searches recursively from any provided starting point. Setting t
         Get-VM searches recursively from any provided starting point. Setting this
         his parameter disables the command recursive behavior.
         parameter disables the command recursive behavior.
          
          
         Required?                    false
         Required?                    false
Line 89: Line 86:
         "get-help about_commonparameters".
         "get-help about_commonparameters".
      
      
INPUT TYPE
=====INPUT TYPE=====
      
      
      
      
      
      
RETURN TYPE
=====RETURN TYPE=====
     VirtualMachine[]
     VirtualMachine[]
      
      
      
      
NOTES
=====NOTES=====
      
      
      
      
Line 107: Line 104:
      
      
      
      
    Retrieves information about all of the virtual machines registered with the
Retrieves information about all of the virtual machines registered with the currently selected VMware Infrastructure server.
    currently selected VMware Infrastructure server.
      
      
      
      
Line 119: Line 115:
      
      
      
      
    This command retrieves information about all virtual machines registered wi
This command retrieves information about all virtual machines registered with the currently-selected VMware Infrastructure server whose names begin with "webTier."
    th the currently-selected VMware Infrastructure server whose names begin wi
    th "webTier."
   
   
      
      
      
      
      
      
      
      
RELATED LINKS
=====RELATED LINKS=====
     [[Remove-VM]]  
     [[Remove-VM]]  
     [[New-VM]]  
     [[New-VM]]  
Line 136: Line 128:
     [[Stop-VM]]  
     [[Stop-VM]]  
     [[Suspend-VM]]
     [[Suspend-VM]]
[[Category: Powershell]][[Category: VI-Toolkit]]

Latest revision as of 13:32, 24 March 2009

NAME
   Get-VM
   

SYNOPSIS

   Gets from a VMware Infrastructure server one or more virtual machines.
   

SYNTAX

   Get-VM [-Datastore <Datastore[]>] [-Location <VIContainer[]>] [[-Name] <Str
   ing[]>] [-Id <String[]>] [-NoRecursion] [-Server <VIServer[]>] [<CommonPara
   meters>]
   
   
DETAILED DESCRIPTION

Gets from a VMware Infrastructure server one or more objects that represent virtual machines. Returns a set of virtual machines that correspond to the filter criteria provided by the cmdlet parameters. For virtual machines with multiple NICs and therefore multiple IP addresses, the "IPAddress" property of the VMGuest object contains all IP addresses of the virtual machine.

The IP at position 0 is the primary IP address.


PARAMETERS

   -Datastore <Datastore[]>
       Gets the virtual machines associated with one or more of the specified datastores. 
       Passing values to this parameter through a pipeline is deprecated 
       and will be removed in one of the following releases.
       
       Required?                    false
       Position?                    named
       Default value                
       Accept pipeline input?       true (ByValue)
       Accept wildcard characters?  true
       
   -Location <VIContainer[]>
       Specifies one or more virtual infrastructure container objects (e.g. folders, 
       datacenters, clusters) to search for virtual machines.
       
       Required?                    false
       Position?                    named
       Default value                
       Accept pipeline input?       true (ByValue)
       Accept wildcard characters?  true
       
   -Name <String[]>
       Specifies one or more names of virtual machine names to get. Use commas
        to separate multiple names. Using wildcards is supported.
       
       Required?                    false
       Position?                    1
       Default value                
       Accept pipeline input?       false
       Accept wildcard characters?  true
       
   -Id <String[]>
       Specifies one or more virtual machine hosts by ID. Use commas to separate 
       multiple IDs.
       
       Required?                    false
       Position?                    named
       Default value                
       Accept pipeline input?       false
       Accept wildcard characters?  true
       
   -NoRecursion
       Get-VM searches recursively from any provided starting point. Setting this 
       parameter disables the command recursive behavior.
       
       Required?                    false
       Position?                    named
       Default value                
       Accept pipeline input?       false
       Accept wildcard characters?  false
       
   -Server <VIServer[]>
       One or more virtual Infrastructure servers to apply the command on. If 
       no value is given to this parameter, the command takes the server curre
       ntly specified in the $DefaultVIServer variable.
       
       Required?                    false
       Position?                    named
       Default value                
       Accept pipeline input?       false
       Accept wildcard characters?  false
       
   <CommonParameters>
       This cmdlet supports the common parameters: -Verbose, -Debug,
       -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
       -OutBuffer and -OutVariable. For more information, type,
       "get-help about_commonparameters".
   
INPUT TYPE
RETURN TYPE
   VirtualMachine[]
    
   
NOTES
   --------------  EXAMPLE 1 --------------
   
   C:\PS>Get-VM
   
   

Retrieves information about all of the virtual machines registered with the currently selected VMware Infrastructure server.



   --------------  EXAMPLE 2 --------------
   
   C:\PS>Get-VM -Name webTier*
   
   

This command retrieves information about all virtual machines registered with the currently-selected VMware Infrastructure server whose names begin with "webTier."



RELATED LINKS
   Remove-VM 
   New-VM 
   Set-VM 
   Move-VM 
   Start-VM 
   Stop-VM 
   Suspend-VM