Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find all of the COM objects that can be created in Powershell?

Tags:

powershell

com

In Powershell I can create COM objects which can be used, for example, to control Microsoft Office applications:

$excel = New-Object -com "Excel.Application" $excel.visible = $true 

How can I list all of the available COM objects that can be created in Powershell?

like image 319
John Channing Avatar asked Mar 18 '09 22:03

John Channing


People also ask

What are COM objects in PowerShell?

ComObject, or plain COM, increases the range of PowerShell activities. One way of looking at COM objects is as a mechanism for PowerShell to launch programs, for example, mimicking the RUN command. Another way of looking at ComObjects is performing the role previously undertaken by VBScript.

How do I get all the properties of an object in PowerShell?

How to get all properties and methods available for the service in PowerShell? To display all the properties and methods available for the get-service cmdlet you need to pipeline Get-Member (alias gm). MemberType 'Property' is to display the specific property like machinename, servicename, etc.

How do I get an object in PowerShell?

The Get-Member cmdlet gets the members, the properties and methods, of objects. To specify the object, use the InputObject parameter or pipe an object to Get-Member . To get information about static members, the members of the class, not of the instance, use the Static parameter.


1 Answers

I found this powershell one-liner script that supposedly lists all COM objects.

gci HKLM:\Software\Classes -ea 0| ? {$_.PSChildName -match '^\w+\.\w+$' -and (gp "$($_.PSPath)\CLSID" -ea 0)} | ft PSChildName 

let us know if it works!

like image 67
Jeff Atwood Avatar answered Sep 19 '22 06:09

Jeff Atwood