Remove-SCSMEmailTemplate
Remove-SCSMEmailTemplate
Removes an email template from Service Manager.
Sintaxis
Parameter Set: Default
Remove-SCSMEmailTemplate [-EmailTemplate] <EmailTemplate[]> [-Confirm] [-WhatIf] [ <CommonParameters>]
Descripción detallada
The Remove-SCSMEmailTemplate cmdlet removes an email template from Service Manager.
Parámetros
-EmailTemplate<EmailTemplate[]>
Specifies an object that represents the email template to be removed.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
1 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
true (ByValue) |
¿Aceptar caracteres comodín? |
false |
-Confirm
Solicita confirmación antes de ejecutar el cmdlet.
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
falso |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-WhatIf
Muestra lo que sucedería si se ejecutara el cmdlet. El cmdlet no se ejecuta.
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
falso |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
<CommonParameters>
Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Entradas
El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.
Microsoft.EnterpriseManagement.ServiceManager.Sdk.Notifications.EmailTemplate
You can pipe an email template to the EmailTemplate parameter.
Salidas
El tipo de resultado es el tipo de objetos que emite el cmdlet.
None.
This cmdlet does not generate any output.
Ejemplos
Example 1: Remove all email templates that match a display name string
This command removes all email templates where the DisplayName property matches the string custom. The command gets all email templates by using the Get-SCSMEmailTemplate cmdlet. The command passes the results to the Where-Object cmdlet by using the pipeline operator. That cmdlet passes on only the results that match the display name to the current cmdlet. That cmdlet deletes each template.
PS C:\>Get-SCSMEmailTemplate | Where-Object { $_.displayname -match "custom" } | Remove-SCSMEmailTemplate
Example 2: Remove all email templates that match a description string
The first command uses Get-SCSMEmailTemplate to get all email templates, and passes them to Where-Object. The command stores all the objects that match the Description property as specified in the $Templates variable.
The second command remove all templates in $Templates.
PS C:\>$Templates = Get-SCSMEmailTemplate | Where-Object {$_.Description -match "notification"}
PS C:\> Remove-SCSMEmailTemplate -EmailTemplate $Templates