在哪里可以找到可以在 Powershell 中创建的所有 COM 对象? [英] Where can I find all of the COM objects that can be created in Powershell?
本文介绍了在哪里可以找到可以在 Powershell 中创建的所有 COM 对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 Powershell 中,我可以创建 COM 对象,例如用于控制 Microsoft Office 应用程序:
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
如何列出可以在 Powershell 中创建的所有可用 COM 对象?
How can I list all of the available COM objects that can be created in Powershell?
推荐答案
我发现了这个 powershell 单行脚本,据说可以列出所有 COM 对象.
I found this powershell one-liner script that supposedly lists all COM objects.
gci HKLM:SoftwareClasses -ea 0| ? {$_.PSChildName -match '^w+.w+$' -and
(gp "$($_.PSPath)CLSID" -ea 0)} | ft PSChildName
让我们知道它是否有效!
let us know if it works!
这篇关于在哪里可以找到可以在 Powershell 中创建的所有 COM 对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文