Removing Static Patch Categories

Deletes the specified Static Patch Category object(s).


Examples:


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


This code removes the Static Patch Category "System-Tools" in the context "Patch Library":


Remove-EmdbPatchCategory "emdb:\rootDSE\Global Software Library\Patch Library\System-Tools" 


The following snippet deletes the Static Patch Category "Office" in the current context:


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

Remove-EmdbPatchCategory "Office"


Alternatively, the code below removes the Static Patch Category named "System-Tools" using the Delete()-method:


$MyPatchCategory = Get-EmdbPatchCategory "emdb:\rootDSE\Global Software Library\Patch Library\System-Tools"

$MyPatchCategory.Delete()


Remove the Static Patch Category named "Graphics Software" using the cmdlet Remove-Item:


Remove-Item "emdb:\rootDSE\Global Software Library\Patch Library\Graphics Software"


Hint: Alternatively the alias DEL can be used to remove Static Software Category objects.


Starting with PSX 3.1 there was a new option implemented when deleting Patch Category 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.