Removing Dynamic Patch Categories

Deletes the specified Dynamic Patch Category object(s).


Examples:


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


Remove the Dynamic Patch Category named "Microsoft Patches" from the "Patch Library" using the method Delete():


$MyPatchCategory = Get-EmdbPatchCategory "emdb:\rootDSE\Global Software Library\Patch Library\Microsoft Patches"

$MyPatchCategory.Delete()


Remove the Dynamic Patch Category named "Adobe Reader" using the cmdlet Remove-Item:


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


Hint: Alternatively the alias DEL can be used to remove Dynamic Patch 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.