New-SCPackageMapping

Creates a package mapping object.

Description

The New-SCPackageMapping cmdlet creates a package mapping object. A package mapping object binds resources to a template. For information about how to update the bindings in a package mapping objec, see Set-SCPackageMapping.

For more information about New-SCPackageMapping, type: "Get-Help New-SCPackageMapping -online".

Parameters

TemplatePackage

Required? false
Accept Pipeline Input? false
Position? named
Specifies an exported template package that contains seralized settings of a service or virtual machine template.

VMMServer

Required? false
Accept Pipeline Input? false
Position? named
Specifies a VMM server object.

Path

Required? false
Accept Pipeline Input? false
Position? named
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]”

Wildcards are supported for "Get" cmdlets and when you specify the UNC path:

Example format:
 UNC path		 -Path "\\VMHostServer\MyVMs\*VM*"

PreferPackageResources

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the resources exported with the package are retained even if similar resources exist at the import destination.

VMMServer

Required? false
Accept Pipeline Input? false
Position? named
Specifies a VMM server object.

Examples

1: Create a package mapping for a template package.
PS C:\> $TemplatePackage = Get-SCTemplatePackage -Path "C:\TemplateExports\VMTemplate01.xml"
PS C:\> $Mappings = New-SCPackageMapping -TemplatePackage $TemplatePackage 
The first command gets the template package at the specified path.

The second command creates a package mapping object for the package stored in $TemplatePackage and stores the object in the $Mappings variable.

See Also