vSphere PowerCLI Cmdlets Reference

Get-Template

Synopsis

Retrieves the virtual machine templates available on a vSphere server.

Syntax

Get-Template [-Location <VIContainer[]>] [[-Name] <String[]>] [-Id <String[]>] [-NoRecursion] [-Server <VIServer[]>] [<CommonParameters>]

Related Commands

Online version
New-Template
Remove-Template
Set-Template

Detailed Description

Retrieves the virtual machine templates available on a vSphere server. The cmdlet returns a set of templates that correspond to the filter criteria defined by the cmdlet parameters. To specify a server different from the default one, use the -Server parameter.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
NameString[]Specify the names of the virtual machine templates you want to retrieve.falsefalse
IdString[]Specify the IDs of the virtual machine templates you want to retrieve.falsefalse
LocationVIContainer[]Specifies the vSphere container objects (such as folders, datacenters, and clusters) you want to search for templates.falsetrue (ByValue)
NoRecursionSwitchParameterIndicate that you want to disable the recursive behavior of the command.falsefalse
ServerVIServer[]One or more vSphere servers to apply the command on. If no value is given to this parameter, the command runs on the server currently specified in the $DefaultVIServer variable.falsefalse

Return Type

Template

Notes

Examples

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

Get-Template -Name Web* -Location Datacenter

Retrieves all virtual machine templates in the Datacenter datacenter, whose names start with "Web".


Copyright © 1998 - 2010 VMware, Inc. All rights reserved.