New-SCServiceTemplate
创建用于在 VMM 中创建服务的服务模板。
语法
New-SCServiceTemplate
[-Name] <String>
[-Description <String>]
[-Owner <String>]
-Release <String>
[-UseAsDefaultRelease <Boolean>]
[-VMMServer <ServerConnection>]
[-UserRole <UserRole>]
[-ServicePriority <ServicePriority>]
[-ServiceTemplate <ServiceTemplate>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[<CommonParameters>]
说明
New-SCServiceTemplate cmdlet 创建用于在 Virtual Machine Manager(VMM)中创建服务的服务模板。 服务模板是一项服务的说明,其中包含一组服务模板,用于描述服务应如何部署、配置和服务。 服务模板存储在 VMM 库中。
示例
示例 1:创建服务模板
PS C:\> $SvcTemplate = New-SCServiceTemplate -Name "ServiceTemplate01" -Release "Beta" -Description "Service Template 01" -Owner "Contoso\Katarina"
PS C:\> $SvcTemplate
第一个命令创建名为 ServiceTemplate01 的服务模板对象,并将该对象存储在$SvcTemplate变量中。
第二个命令向用户显示有关服务模板对象的信息。
示例 2:克隆服务模板
PS C:\> $SvcTemplate = Get-SCServiceTemplate -Name "ServiceTemplate01" | where { $_.Release -eq "Beta" }
PS C:\> $NewSvcTemplate = New-SCServiceTemplate -Name "ServiceTemplate01" -Release "v1" -ServiceTemplate $SvcTemplate
PS C:\> $NewSvcTemplate
第一个命令使用 Beta 版本获取名为 ServiceTemplate01 的服务模板对象,并将对象存储在$SvcTemplate变量中。
第二个命令创建 ServiceTemplate01 的克隆,并为其提供 v1 的发布值。 然后,该命令将服务模板对象存储在$NewSvcTemplate变量中。
最后一个命令向用户显示有关克隆的服务模板对象的信息。
参数
-Description
指定服务模板的说明。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-JobVariable
指定在此参数命名的变量中跟踪和存储作业进度。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Name
指定 VMM 对象的名称。
类型: | String |
Position: | 0 |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Owner
以有效的域用户帐户的形式指定 VMM 对象的所有者。
- 示例格式:
-Owner "Contoso\PattiFuller"
- 示例格式:
-Owner "PattiFuller@Contoso"
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-PROTipID
指定触发此操作的性能和资源优化提示(PRO 提示)的 ID。 此参数允许你审核 PRO 提示。
类型: | Guid |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Release
指定描述库资源的发布的字符串。 VMM 会自动为导入库的每个资源创建发布值。 导入资源后,可以自定义字符串。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-RunAsynchronously
指示作业以异步方式运行,以便控件立即返回到命令行界面。
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ServicePriority
指定服务的优先级。 有效值为:Normal、Low、High。 默认值:普通。
类型: | ServicePriority |
接受的值: | Normal, Low, High |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-ServiceTemplate
指定服务模板对象。
类型: | ServiceTemplate |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
-UseAsDefaultRelease
指示此版本是否用作服务模板的默认版本。
类型: | Boolean |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-UserRole
指定用户角色对象。
类型: | UserRole |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-VMMServer
指定 VMM 服务器对象。
类型: | ServerConnection |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | True |
接受通配符: | False |
输出
ServiceTemplate
此 cmdlet 返回 ServiceTemplate 对象。