Remove-SCServiceTemplate

Deletes a service template from the VMM library.

Syntax

Remove-SCServiceTemplate [-ServiceTemplate] <ServiceTemplate> [-Confirm] [-JobVariable <String>]
 [-PROTipID <Guid>] [-RunAsynchronously] [-WhatIf] [<CommonParameters>]

Description

The Remove-SCServiceTemplate cmdlet deletes one or more service templates from the VMM library.

Examples

Example 1: Remove a specific service template from the library

PS C:\> $SvcTemplate = Get-SCServiceTemplate -VMMServer "VMMServer01.Contoso.com" -Name "ServiceTemplate01"
PS C:\> Remove-SCServiceTemplate -ServiceTemplate $SvcTemplate -Confirm

The first command gets the service template object named ServiceTemplate01 and stores the object in the $SvcTemplate variable.

The second command removes the service template object in $SvcTemplate from the VMM database and deletes the corresponding service template object and all other associated objects in the library. A confirmation prompt is displayed before the the service template object is removed.

Example 2: Remove all service templates from the library

PS C:\> $SvcTemplates = Get-SCServiceTemplate -VMMServer "VMMServer01.Contoso.com"
PS C:\> $SvcTemplates | Remove-SCServiceTemplate -Confirm

The first command gets all service template objects on VMMServer01 and stores the objects in the $SvcTemplates variable.

The second command removes all service template objects from the VMM database and deletes the corresponding service template object and all other associated objects in the library. A confirmation prompt is displayed before the service template objects are removed.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-JobVariable

Specifies that job progress is tracked and stored in the variable named by this parameter.

Type:String
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Required:False
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

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

Specifies a service template object.

Type:ServiceTemplate
Required:True
Position:0
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Required:False
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False