Removing Members from Static Patch Categories

Members from Static Patch Categories are removed by calling the method RemoveMember() of the Patch Category object.

Examples:


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


Remove the Patch Package named "CHROME-108 for Google Chrome 36" from the Static Patch Category named "System-Tools" in the "Patch Library":


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

$MyPatchPackage = Get-EmdbSoftwarePackage "emdb:\rootDSE\Global Software Library\Patch Library\CHROME-108 for Google Chrome 36"

$MyPatchCategory.RemoveMember($MyPatchPackage)


Remove all Patch Packages related to Google Chrome from the Static Patch Category "Browser":


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

$MyPatchPackages = Get-EmdbSoftwarePackage "emdb:\rootDSE\Global Software Library\Patch Library\*" -Filter "(cn:IgnoreCase=*chrome*)"

$MyPatchPackages | ForEach-Object {$MyPatchCategory.RemoveMember($_)}