在哪里可以找到所有可以在Powershell中创建的COM对象? [英] Where can I find all of the COM objects that can be created in Powershell?

查看:159
本文介绍了在哪里可以找到所有可以在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?

推荐答案

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

让我们知道是否有效!

这篇关于在哪里可以找到所有可以在Powershell中创建的COM对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆