Set-SCPackageMapping

Updates a package mapping object.

Syntax

Set-SCPackageMapping
   -PackageMapping <PackageMapping>
   [-TargetObject <ClientObject>]
   [-VMMServer <ServerConnection>]
   [<CommonParameters>]
Set-SCPackageMapping
   -PackageMapping <PackageMapping>
   [-UsePackageFileMapping]
   [-VMMServer <ServerConnection>]
   [<CommonParameters>]
Set-SCPackageMapping
   -PackageMapping <PackageMapping>
   -LocalFile <String>
   [-VMMServer <ServerConnection>]
   [<CommonParameters>]

Description

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

Examples

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

Parameters

-LocalFile

Specifies the location of an exported package.

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

-PackageMapping

Specifies a package mapping object.

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

-TargetObject

Specifies the object to which you want to map a resource.

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

-UsePackageFileMapping

Indicates that the package file is uploaded.

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

-VMMServer

Specifies a VMM server object.

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