Set-SCPackageMapping
Updates a package mapping object.
Syntax
TargetObject
Set-SCPackageMapping
-PackageMapping <PackageMapping>
[-TargetObject <ClientObject>]
[-VMMServer <ServerConnection>]
[<CommonParameters>]
PackageFile
Set-SCPackageMapping
-PackageMapping <PackageMapping>
[-UsePackageFileMapping]
[-VMMServer <ServerConnection>]
[<CommonParameters>]
LocalFile
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.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
LocalFile
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-PackageMapping
Specifies a package mapping object.
Parameter properties
Type: | PackageMapping |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-TargetObject
Specifies the object to which you want to map a resource.
Parameter properties
Type: | ClientObject |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
TargetObject
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-UsePackageFileMapping
Indicates that the package file is uploaded.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
PackageFile
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-VMMServer
Specifies a 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.