Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey All,

Im trying to remove a com+ Application via powershell using the following:



$comCatalog = New-Object -ComObject COMAdmin.COMAdminCatalog
$appColl = $comCatalog.GetCollection("Applications")
$appColl.Populate()

$app = $appColl | where {$_.Name -eq "ApplicationName"}
$compColl = $appColl.GetCollection("Components", $app.Key)
$compColl.Populate()

$index = 0
foreach($component in $compColl) {
    if ($component.Name -eq "SOMECOMPONENT.NAME") {
        $compColl.Remove($index)
        $compColl.SaveChanges()
    }
    $index++
}


The above works for deleting a component but I would ideally like to remove the application all at once.

What I have tried:

I have tried the above with com+ applications I have on my server.
Posted
Updated 12-Aug-19 1:04am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900