Remove-SCSMEmailTemplate
Remove-SCSMEmailTemplate
Removes an email template from Service Manager.
構文
Parameter Set: Default
Remove-SCSMEmailTemplate [-EmailTemplate] <EmailTemplate[]> [-Confirm] [-WhatIf] [ <CommonParameters>]
詳細説明
The Remove-SCSMEmailTemplate cmdlet removes an email template from Service Manager.
パラメーター
-EmailTemplate<EmailTemplate[]>
Specifies an object that represents the email template to be removed.
エイリアス |
なし |
必須? |
true |
位置は? |
1 |
既定値 |
なし |
パイプライン入力を許可する |
true (ByValue) |
ワイルドカード文字を許可する |
false |
-Confirm
コマンドレットを実行する前に、ユーザーに確認を求めます。
必須? |
false |
位置は? |
named |
既定値 |
false |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
-WhatIf
コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。
必須? |
false |
位置は? |
named |
既定値 |
false |
パイプライン入力を許可する |
false |
ワイルドカード文字を許可する |
false |
<CommonParameters>
このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
入力
入力型は、コマンドレットにパイプできるオブジェクトの型です。
Microsoft.EnterpriseManagement.ServiceManager.Sdk.Notifications.EmailTemplate
You can pipe an email template to the EmailTemplate parameter.
出力
出力型は、コマンドレットによって生成されるオブジェクトの型です。
None.
This cmdlet does not generate any output.
例
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