Udostępnij za pośrednictwem


Export-SCTemplate

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

Syntax

VMTemplate

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

ServiceTemplate

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.

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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IncludeAllLibraryResources

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IncludeLibraryResources

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

Parameter properties

Type:

ItemBase[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Password

Specifies a secure string that contains a password.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-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\]"

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ServiceTemplate

Specifies a service template object.

Parameter properties

Type:ServiceTemplate
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ServiceTemplate
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-SettingsIncludePrivate

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-VMMServer

Specifies a VMM server object.

Parameter properties

Type:ServerConnection
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-VMTemplate

Specifies a VMM template object used to create virtual machines.

Parameter properties

Type:Template
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VMTemplate
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

SCTemplate

This cmdlet returns an SCTemplate object.