nullByteMe
nullByteMe

Reputation: 6391

How can I call a method from a powershell?

I'm trying to obtain information that Microsoft says I get by running the following command:

IWindowsUpdateAgentInfo::GetInfo

The problem is, I don't know how to run this command in powershell. I get the following error message when trying to run it this way:

[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

What am I doing wrong here?

Upvotes: 1

Views: 473

Answers (1)

CB.
CB.

Reputation: 60910

Is a comobject, try this:

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

Upvotes: 2

Related Questions