Solution 1: This command Clear the package (Make sure to replace the name of the package FWXXXXXX with the correct one)
foreach($i in gwmi -Namespace root/ccm/policy/machine/actualconfig -Class ccm_softwaredistribution -Filter "ADV_AdvertisementID='FWXXXXXX'"){$i.delete()}
Solution 2 : This script clean the WMI Object
$ccmProgram = Get-WmiObject -Namespace ROOT\CCM\ClientSDK -Class CCM_Program | Where-Object {$_.EvaluationState –eq 14}
If ($ccmProgram -ne $null)
{
$ccmExecutionRequestEx = Get-WmiObject -Namespace ROOT\CCM\SoftMgmtAgent –Class CCM_ExecutionRequestEx | Where-Object {$_.RunningState -eq "NotifyExecution" -and $_.AdvertID -gt "" -and $_.ContentID -eq $ccmProgram.PackageID}
If ($ccmExecutionRequestEx -ne $null)
{
$ccmExecutionRequestEx | Remove-WmiObject
Start-Process sc.exe -ArgumentList "config smstsmgr depend= winmgmt/ccmexec" -Wait
Restart-Service -Name CcmExec -Force
}
}