我正在尝试通过运行以下命令来获取Microsoft所说的信息:
IWindowsUpdateAgentInfo::GetInfo
问题是,我不知道如何在powershell中运行此命令。尝试以这种方式运行时,我收到以下错误消息:
[Microsoft.Update.IWindowsUpdateAgentInfo]::GetIno
Unable to find type [Microsoft.Update.IWindowsUpdateAgentInfo]: make sure that the assembly containing this type is
loaded.
At line:1 char:1
+ [Microsoft.Update.IWindowsUpdateAgentInfo]::GetInfo
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.Update.IWindowsUpdateAgentInfo:TypeName) [], RuntimeExcep
tion
+ FullyQualifiedErrorId : TypeNotFound
我在这里做错了什么?
答案 0 :(得分:2)
是一个comobject,试试这个:
[version](New-Object -ComObject Microsoft.Update.AgentInfo).
GetInfo('ProductVersionString')