Remove-SCServiceTemplate
Deletes a service template from the VMM library.
Syntax
Remove-SCServiceTemplate
[-ServiceTemplate] <ServiceTemplate>
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<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 |
Position: | Named |
Default value: | False |
Required: | 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 |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Position: | Named |
Default value: | None |
Required: | False |
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 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ServiceTemplate
Specifies a service template object.
Type: | ServiceTemplate |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |