gpt4 book ai didi

windows - 如何从 powershell 调用方法?

转载 作者:可可西里 更新时间:2023-11-01 11:55:12 25 4
gpt4 key购买 nike

我正在尝试通过运行以下命令获取 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

我在这里做错了什么?

最佳答案

是一个组合对象,试试这个:

[version](New-Object -ComObject Microsoft.Update.AgentInfo).            
GetInfo('ProductVersionString')

关于windows - 如何从 powershell 调用方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19027777/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com