Retrieving Dynamic Patch Categories

Retrieves the specified Dynamic Patch Category object(s).


Examples:


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


Retrieve the (Dynamic) Patch Category named "Browser" from the "Global Software Library\Patch Library" folder:


Get-EmdbPatchCategory "emdb:\rootDSE\Global Software Library\Patch Library\Browser"


Retrieve all Dynamic Software Categories from the whole "Patch Library" :


Get-EmdbPatchCategory "emdb:\*" -SchemaTag "DynamicPatchMgmtRuleFilter" -Recurse


Retrieve the Dynamic Patch Category named "Freeware and Open Source" from the current context:


Hint: Dynamic Patch Categories can only be created (and therefore only be retrieved) directly in the context of the Patch Library folder.


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

Get-EmdbPatchCategory "Freeware und Open Source" -SchemaTag "DynamicPatchMgmtRuleFilter"


Retrieve the Dynamic Patch Category "Adobe Flash" in the current context through its Item-ID (this ID will vary in different DSM environments):


Get-EmdbPatchCategory -ItemID 9886 -Recurse


Tip: the alias ID can be used instead of ItemID.


Retrieve the Patch Category named "Freeware and Open Source" from the current context using the cmdlet Get-Item:


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

Get-Item "Freeware und Open Source"


Retrieve all Dynamic Patch Categories having their names starting with the substring "S" from "Global Software Library\Patch Library" using the cmdlet Get-Childitem:


Get-ChildItem "emdb:\rootDSE\Global Software Library\Patch Library" -Filter "&(Name=S*)(SchemaTag=DynamicPatchMgmtRuleFilter)"


Starting with PSX 3.1 there was a new option implemented when retrieving Patch Category objects. When specifying the SingleItemExpected-switch it is expected, that none or exactly one object is contained in the result. If the retrieval returns more than one object, an error is raised that can be caught and handled in scripts.