Creating Patch-Template-Rules

Patch-Template-Rules are created using the New-EmdbPatchTemplateRule cmdlet. 


Examples:


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


When creating a new Patch-Template-Rule, the mandatory parameters that must be supplied are the name of the rule and the template to be used. The template is essentially a "normal" Software-Package object, which has to be retrieved in advance:


$MyPatchTemplate = Get-EmdbSoftwarePackage "emdb:\rootDSE\Global Software Library\Patch Library\Templates\Flash-Template"

New-EmdbPatchTemplateRule "Flash-Updates" -Template $MyPatchTemplate


Patch-Template-Rules support the EvaluationOrder-parameter. During evaluation of the rules, the first rule with matching criteria is applied. As a consequence, the order of evaluation is an important aspect. The rule from above could therefore be created with in a more sophisticated way:


New-EmdbPatchTemplateRule "Flash-Updates" -Template $MyPatchTemplate -EvaluationOrder 1


In order to create a Patch-Template-Rule, that is only valid for Patch-Packages of the category "Adobe Flash", the following code could be used for instance:


$MyPatchTemplate = Get-EmdbSoftwarePackage "emdb:\rootDSE\Global Software Library\Patch Library\Templates\Flash-Template"

$MyPatchCategory = Get-EmdbPatchCategory "emdb:\rootDSE\Global Software Library\Patch Library\Adobe Flash"

New-EmdbPatchTemplateRule "Flash-Updates" -Template $MyPatchTemplate -IncludeFilterList $MyPatchCategory