Set-SCApplicationPackage
修改应用程序包的属性。
语法
Set-SCApplicationPackage
[-UserRole <UserRole>]
[-Enabled <Boolean>]
[-VMMServer <ServerConnection>]
[-ApplicationPackage] <ApplicationPackage[]>
[-EncryptionKey <PSCredential>]
[-Name <String>]
[-SharePath <String>]
[-Description <String>]
[-Owner <String>]
[-FamilyName <String>]
[-Release <String>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
Set-SCApplicationPackage
[-VMMServer <ServerConnection>]
[-ApplicationPackage] <ApplicationPackage[]>
[-SetAsEquivalent]
-FamilyName <String>
-Release <String>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
说明
Set-SCApplicationPackage cmdlet 修改存储在 Virtual Machine Manager (VMM) 库中的应用程序包的属性。
示例
示例 1:更新应用程序包的说明
PS C:\> $AppPackage = Get-SCApplicationPackage -Name "WebApp01.zip"
PS C:\> Set-SCApplicationPackage -ApplicationPackage $AppPackage -Description "Web application to install on a service."
第一个命令获取名为WebApp01.zip的应用程序包对象,并将对象存储在$AppPackage变量中。
第二个命令更新WebApp01.zip的说明。
参数
-ApplicationPackage
指定应用程序包对象的数组。
Type: | ApplicationPackage[] |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Description
说明指定对象。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Enabled
当设置为$True时启用对象,或者在设置为$False时禁用对象。 例如,如果您要对虚拟机模板上的软件进行升级,则可以禁用 VMM 库中的模板对象以临时阻止用户使用该对象。
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EncryptionKey
指定将位于外围网络中的 Hyper-V 主机添加到 VMM 时用作加密密钥的凭据。
示例格式: -SecurityFile "C:\SecurityFile.txt" -EncryptionKey $Key
Type: | PSCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-FamilyName
指定 VMM 库中物理资源的系列名称。 此值与 Release、Namespace 和 Type 结合使用,在库资源之间建立等效性。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
指定跟踪作业进度,并将其存储在此参数命名的变量中。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
指定 VMM 对象的名称。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Owner
以一个有效的域用户帐户形式指定 VMM 对象的所有者。
- 示例格式:
-Owner "Contoso\PattiFuller"
- 示例格式:
-Owner "PattiFuller@Contoso"
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
指定触发此操作 (PRO 提示) 的性能和资源优化提示的 ID。 此参数允许审核 PRO 提示。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Release
指定描述库资源的发布的字符串。 VMM 会自动为导入库的每个资源创建发布值。 导入资源后,可以自定义字符串。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
指示作业异步运行,以便控件立即返回到命令 shell。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SetAsEquivalent
指示 cmdlet 将多个应用程序包标记为等效。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SharePath
指定现有库服务器上使用通用命名约定 (UNC) 路径的一个有效库共享路径。
示例格式: -SharePath "\\LibServer01\LibShare"
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UserRole
指定一个用户角色对象。
Type: | UserRole |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VMMServer
指定VMM 服务器对象。
Type: | ServerConnection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
输出
ApplicationPackage
此 cmdlet 返回 ApplicationPackage 对象。