Removing Patch-Template-Rules

This chapter describes deleting Patch-Template-Rule-objects.


Hint: The execution of these examples requires a connected PowerShell drive.

To delete Patch-Template-Rule-objects, the Remove-EmdbPatchTemplateRule cmdlet is used. The Rule "Mozilla Firefox", that was created beforehand, can be deleted using the following commands:

Remove-EmdbPatchTemplateRule "Mozilla Firefox"

Alternatively, the Delete()-method of the corresponding object can be used, as the following example shows:

$MyPatchTemplateRule = Get-EmdbPatchTemplateRule "Java"


Remove the Patch-Template-Rule named "Flash-Updates" using the cmdlet Remove-Item:

Remove-Item "emdb:\rootCatalog\Flash-Updates"

Note: Note that Patch-Template-Rule-objects are not part of the context rootDSE and therefore they can be referenced without a full qualified path resp. an absolute path.

Starting with PSX 3.1 there was a new option implemented when deleting Patch-Template-Rule objects. When specifying the SingleItemExpected-switch it is expected, that none or exactly one object is affected. If the command would delete more than one object, an error is raised that can be caught and handled in scripts.