Retrieving Static Patch Categories

Retrieves the specified Static Patch Category object(s).


Examples:


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


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


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


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


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


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


Hint: Static 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 "PatchMgmtRuleFilter"


Retrieve the Static Patch Category "Critical 3rd Party" in the current context through its Item-ID (this ID will vary in different DSM environments):


Get-EmdbPatchCategory -ItemID 4775 -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 Static 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=PatchMgmtRuleFilter)"


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.