Remove-SCServiceTemplate

Deletes a service template from the VMM library.

Description

The Remove-SCServiceTemplate cmdlet deletes one or more service templates from the System Center Virtual Machine Manager (VMM) library.

For more information about Remove-SCServiceTemplate, type: "Get-Help Remove-SCServiceTemplate -online".

Parameters

ServiceTemplate

Required? true
Accept Pipeline Input? true (ByValue)
Position? 0
Specifies a service template object.

Confirm

Required? false
Accept Pipeline Input? false
Position? named
Prompts for confirmation before running the command.

JobVariable

Required? false
Accept Pipeline Input? false
Position? named
Specifies that job progress is tracked and stored in the variable named by this parameter. 

PROTipID

Required? false
Accept Pipeline Input? false
Position? named
Specifies the ID of the PRO tip that triggered this action. This allows for auditing of PRO tips.

RunAsynchronously

Required? false
Accept Pipeline Input? false
Position? named
Indicates that the job runs asynchronously so that control returns to the command shell immediately. 

Examples

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.
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.

See Also