Click here to Skip to main content
14,271,874 members
Rate this:
Please Sign up or sign in to vote.
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100