A way to delete Software Update templates from SCCM
List all SUP templates:
$computer = $env:COMPUTERNAME
$namespace = “ROOT\SMS\site_ps1”
$classname = “SMS_Template”
$SiteServer = “Siteserver”
$SoftwareUpdateTemplate = Get-WmiObject -Namespace $NameSpace -Query “Select * from SMS_Template where type = 0” -ComputerName $SiteServer
$SoftwareUpdateTemplate.name
note:
type 0 = Software Update template
Type 1 = Automatic Deployment Rules template
Delete the SUP template named “Templatename”
$computer = $env:COMPUTERNAME
$namespace = “ROOT\SMS\site_ps1”
$classname = “SMS_Template”
$SiteServer = “Siteserver”
$SUPTemplateName = “templatename”
$SoftwareUpdateTemplate = Get-WmiObject -Namespace $NameSpace -Query “Select * from SMS_Template where Name =’$SUPTemplateName'” -ComputerName $SiteServer -ErrorAction STOP
$SoftwareUpdateTemplate.Delete()