Set-SCPackageMapping

Updates a package mapping object.

Description

The Set-SCPackageMapping cmdlet updates a package mapping object. To create a package mapping object, see New-SCPackageMapping.

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

Parameters

PackageMapping

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a package mapping object.

LocalFile

Required? true
Accept Pipeline Input? false
Position? named
Specifies the location of an exported package.

VMMServer

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

PackageMapping

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a package mapping object.

UsePackageFileMapping

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the package file is uploaded.

VMMServer

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

PackageMapping

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a package mapping object.

TargetObject

Required? true
Accept Pipeline Input? false
Position? named
Specifies the object to which you want to map a resource.

VMMServer

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

Examples

1: Update a package mapping object.
PS C:\> $TemplatePackage = Get-SCTemplatePackage -Path "C:\TemplateExports\ServiceTemplate01.new.xml"
PS C:\> $Mappings = New-SCPackageMapping -TemplatePackage $TemplatePackage
PS C:\> $Mapping = $Mappings | where {$_.PackageID -eq "VHD01.vhd"}
PS C:\> $Resource = Get-SCVirtualHardDisk -Name "VHD01.vhd"
PS C:\> Set-SCPackageMapping -PackageMapping $Mapping -TargetObject $Resource
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.

The third command gets a mapping object by package ID and stores the object in the $Mapping variable.

The fourth command gets the virtual hard disk object named VHD01 and stores the object in the $Resource variable.

The last command binds the mapping stored in $Mapping to the object stored in $Resource (VHD01).

See Also