Share via


Update-SCSMEmailTemplate

Updates properties of an email template.

Syntax

Default (Default)

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.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EmailTemplate

Specifies the email template that this cmdlet updates.

Parameter properties

Type:

Microsoft.EnterpriseManagement.ServiceManager.Sdk.Notifications.EmailTemplate[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-PassThru

Indicates that this cmdlet returns the email template that it updates. You can pass this object to other cmdlets.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

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.