Export-SCTemplate

Exports a template from the VMM library to the specified path.

Syntax

Export-SCTemplate
      [-VMTemplate] <Template>
      -Path <String>
      [-SettingsIncludePrivate]
      [-Overwrite]
      [-Password <String>]
      [-IncludeLibraryResources <ItemBase[]>]
      [-AllowUnencryptedTransfer]
      [-IncludeAllLibraryResources]
      [-VMMServer <ServerConnection>]
      [<CommonParameters>]
Export-SCTemplate
      [-ServiceTemplate] <ServiceTemplate>
      -Path <String>
      [-SettingsIncludePrivate]
      [-Overwrite]
      [-Password <String>]
      [-IncludeLibraryResources <ItemBase[]>]
      [-AllowUnencryptedTransfer]
      [-IncludeAllLibraryResources]
      [-VMMServer <ServerConnection>]
      [<CommonParameters>]

Description

The Export-SCTemplate cmdlet exports a template from the Virtual Machine Manager (VMM) library to the specified path. You can also export the library objects on which the template is dependent.

Examples

Example 1: Export a service template with all of its settings

PS C:\> $ServiceTemplate = Get-SCServiceTemplate -Name "ServiceTemplate01"
PS C:\> Export-SCTemplate -ServiceTemplate $ServiceTemplate -Path "C:\TemplateExports" -SettingsIncludePrivate -Overwrite

The first command gets the service template object named ServiceTemplate01 and stores the object in the $ServiceTemplate variable.

The second command exports the service template stored in $ServiceTemplate, including all settings, and overwrites existing template export packages that have the same name.

Example 2: Export multiple service templates with all of their settings

PS C:\> Get-SCServiceTemplate | Export-SCTemplate -Path "C:\TemplateExports" -SettingsIncludePrivate -Overwrite

This command uses the Get-SCServiceTemplate cmdlet to get all service template objects. Then, it uses the pipeline operator to send the objects to the Export-SCTemplate cmdlet, which exports the templates, overwriting any existing files.

Example 3: Export a service template including its dependent library resources

PS C:\> $ServiceTemplate = Get-SCServiceTemplate -Name "ServiceTemplate01"
PS C:\> Export-SCTemplate -ServiceTemplate $ServiceTemplate -Path "C:\TemplateExports" -IncludeAllLibraryResources

The first command gets the service template object named ServiceTemplate01 and stores the object in the $ServiceTemplate variable.

The second command exports ServiceTemplate01 and all of its dependent resources from the VMM library to C:\TempalteExports.

Required Parameters

-Path

Specifies the destination path for the operation.

Example formats:

  • Local path: -Path "F:\"
  • UNC path: -Path "\\Library\Templates"
  • Volume GUID path: -Path "\\?\Volume{4703c1ea-8ae7-11db-b473-00123f7603e3}\"
  • VMware ESX path: -Path "\[storage1\]\MyVMwareFolderForVMs\MyVM.vmx"
  • Citrix XenServer path: -Path "Local storage\[99b6212f-b63d-c676-25f9-d6c460992de7\]"
Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ServiceTemplate

Specifies a service template object.

Type:ServiceTemplate
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-VMTemplate

Specifies a VMM template object used to create virtual machines.

Type:Template
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-AllowUnencryptedTransfer

Indicates that network file transfers do not require encryption. If you allow unencrypted network file transfers, it can improve performance if neither the source host nor the destination host requires encryption.

Use this parameter to:

  • Allow unencrypted file transfers into, or out of, the library.
  • Allow unencrypted file transfers into, out of, or within a host group.
Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IncludeAllLibraryResources

Indicates that all of the dependencies for a template are exported from the VMM library with the template.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IncludeLibraryResources

Specifies dependent library resources that are to be exported with a template.

Type:ItemBase[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Overwrite

Indicates that an import or export operation overwrites an existing file with the same name. Or, that an import operation overwrites an existing virtual machine template or service template object with the same name.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Password

Specifies a secure string that contains a password.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SettingsIncludePrivate

Indicates that sensitive template settings are included in an import or export operation.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-VMMServer

Specifies a VMM server object.

Type:ServerConnection
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Outputs

SCTemplate

This cmdlet returns an SCTemplate object.