Set-SCPackageMapping

Set-SCPackageMapping

Updates a package mapping object.

構文

Parameter Set: LocalFile
Set-SCPackageMapping -LocalFile <String> -PackageMapping <PackageMapping> [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: PackageFile
Set-SCPackageMapping -PackageMapping <PackageMapping> -UsePackageFileMapping [-VMMServer <ServerConnection> ] [ <CommonParameters>]

Parameter Set: TargetObject
Set-SCPackageMapping -PackageMapping <PackageMapping> [-TargetObject <ClientObject> ] [-VMMServer <ServerConnection> ] [ <CommonParameters>]

詳細説明

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

パラメーター

-LocalFile<String>

Specifies the location of an exported package.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-PackageMapping<PackageMapping>

Specifies a package mapping object.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

-TargetObject<ClientObject>

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

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-UsePackageFileMapping

Indicates that the package file is uploaded.

エイリアス

none

必須?

true

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-VMMServer<ServerConnection>

Specifies a VMM server object.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

Example 1: Update a package mapping object

The first command gets the template package at the specified path, and then stores it in the $TemplatePackage variable.

The second command creates a package mapping object for the package stored in $TemplatePackage, and then stores the object in the $Mappings variable.

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

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

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

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

関連トピック

New-SCPackageMapping

Get-SCVirtualHardDisk

Get-SCTemplatePackage