Set-SCPackageMapping

Updates a package mapping object.

Syntax

Set-SCPackageMapping -LocalFile <String> -PackageMapping <PackageMapping> [-VMMServer <ServerConnection>]
 [<CommonParameters>]
Set-SCPackageMapping -PackageMapping <PackageMapping> [-TargetObject <ClientObject>]
 [-VMMServer <ServerConnection>] [<CommonParameters>]
Set-SCPackageMapping -PackageMapping <PackageMapping> [-UsePackageFileMapping] [-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
Required:True
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PackageMapping

Specifies a package mapping object.

Type:PackageMapping
Required:True
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-TargetObject

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

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

Indicates that the package file is uploaded.

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

Specifies a VMM server object.

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