Update-SCSMEmailTemplate
Updates properties of an email template.
Syntax
Update-SCSMEmailTemplate
[-EmailTemplate] <EmailTemplate[]>
[-PassThru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Update-SCSMEmailtemplate cmdlet updates properties of an email template.
Examples
Example 1: Update the subject of an email 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
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.
Example 2: Add a German entry to an email 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
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.
Parameters
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | System.Management.Automation.SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EmailTemplate
Specifies the email template that this cmdlet updates.
Type: | Microsoft.EnterpriseManagement.ServiceManager.Sdk.Notifications.EmailTemplate[] |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-PassThru
Indicates that this cmdlet returns the email template that it updates. You can pass this object to other cmdlets.
Type: | System.Management.Automation.SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | System.Management.Automation.SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Microsoft.EnterpriseManagement.ServiceManager.Sdk.Notifications.EmailTemplate
You can pipe an email template to the EmailTemplate parameter.
Outputs
None.
This cmdlet does not generate any output.