New-SCPackageMapping

Creates a package mapping object.

Syntax

New-SCPackageMapping
   -Path <String>
   [-PreferPackageResources]
   [-VMMServer <ServerConnection>]
   [<CommonParameters>]
New-SCPackageMapping
   -TemplatePackage <Package>
   [-VMMServer <ServerConnection>]
   [<CommonParameters>]

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 object, see Set-SCPackageMapping.

Examples

Example 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.

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
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-PreferPackageResources

Indicates that the resources exported with the package are retained even if similar resources exist at the import destination.

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

-TemplatePackage

Specifies an exported template package that contains serialized settings of a service or virtual machine template.

Type:Package
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VMMServer

Specifies a Virtual Machine Manager (VMM) server object.

Type:ServerConnection
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Outputs

PackageMapping

This cmdlet returns a PackageMapping object.