New-SCPackageMapping
Creates a package mapping object.
Syntax
Path
New-SCPackageMapping
-Path <String>
[-PreferPackageResources]
[-VMMServer <ServerConnection>]
[<CommonParameters>]
Package
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\]"
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
Path
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-PreferPackageResources
Indicates that the resources exported with the package are retained even if similar resources exist at the import destination.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
Path
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-TemplatePackage
Specifies an exported template package that contains serialized settings of a service or virtual machine template.
Parameter properties
Type: | Package |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
Package
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-VMMServer
Specifies a Virtual Machine Manager (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 |
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
PackageMapping
This cmdlet returns a PackageMapping object.