Creating Dynamic Patch Categories

Creates a Dynamic Patch Category object.


Hint: Dynamic Patch Categories can only be created directly in the context of the Patch Library folder.


Examples:


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


Create a Dynamic Patch Category named "Adobe" in the "Patch Library" context:


$MyPatchCompanyID = $(Get-Item -Path emdb:\rootCatalog\Adobe -Filter "(SchemaTag=PatchProductCompany)").ID

Cd "emdb:\rootDSE\Global Software Library\Patch Library"

$MyPatchCategory = New-EmdbPatchCategory "Adobe" -Dynamic -Filter "(PatchPackage.Company:ContainedIn=$MyPatchCompanyID)"


Hint: In the context of the emdb drive, the cmdlet New-Item provides the additional parameter -DelayCreation. Using this parameter creates the object on the client side only and doesn't propagate the changes to the DSMDB instantly. Now you can manipulate properties of this object and finally the changes can be propagated to the DSMDB by calling the method Create(). This is an alternative way of specifying the value of the TargetCategory property.


Create a Dynamic Patch Category "Office 2010" using the New-Item cmdlet:


$MyPatchFamilyID = $(Get-ChildItem -path "emdb:\rootCatalog\Office 2010" -Filter "SchemaTag=PatchProductFamily").ID

Cd "emdb:\rootDSE\Global Software Library\Patch Library"

$MyNewPatchCategory = New-Item "Office 2010" -ItemType "DynamicPatchMgmtRuleFilter" -DelayCreation

$MyNewPatchCategory.TargetCategory = "VMWPPatchPackage"

$MyNewPatchCategory.Filter = "(PatchPackage.ProductFamily:ContainedIn=$MyPatchFamilyID)"

$MyNewPatchCategory.Create()