Update-SCSMEmailTemplate
Update-SCSMEmailTemplate
Updates properties of an email template.
Sintaxis
Parameter Set: Default
Update-SCSMEmailTemplate [-EmailTemplate] <EmailTemplate[]> [-PassThru] [-Confirm] [-WhatIf] [ <CommonParameters>]
Descripción detallada
The Update-SCSMEmailtemplate cmdlet updates properties of an email template.
Parámetros
-EmailTemplate<EmailTemplate[]>
Specifies an object that represents the email template to update.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
1 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
true (ByValue) |
¿Aceptar caracteres comodín? |
false |
-PassThru
Specifies the output object that represents the email template to update. This output object can be passed to other cmdlets.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿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: Update the subject of an email template
The first command gets an email template that has the specified display name by using the Get-SCSMEmailTemplate cmdlet. The command stores that template in the $Template variable.
The second command assigns a new value to the Subject property of $Template.
The final command updates the email template to match the current value of $Template.
PS C:\>$Template = Get-SCSMEmailTemplate -DisplayName "Template01"
PS C:\> $Template.Subject = "This is a changed subject for an email template"
PS C:\> Update-SCSMEmailTemplate -EmailTemplate $Template
Example 2: Add a German entry to an email template
The first command gets an email template that has the specified display name, and then stores that template in the $Template variable.
The second command assigns a new value to the TemplateCollection property of $Template. The command adds a German email entry to the current template.
The final command updates the email template to match the current value of $Template.
PS C:\>$Template = Get-SCSMEmailTemplate -DisplayName "Template02"
PS C:\> $Template.TemplateCollection += @{
>> Body = @'
>> Der Windows-Computer wurde aktualisiert
>> ($Context/Property[Type='System!System.Entity']/DisplayName$
>> '@
>> Encoding = [Text.Encoding]::Ascii
>> Language = [globalization.cultureinfo]"de-DE"
>> }
PS C:\> Update-SCSMEmailTemplate -EmailTemplate $Template