I have the following code in C# which I try to port to PowerShell. But I don't know how to port this cast:
((_ISkypeEvents_Event)skype).CallStatus += CallStatusHandler;
If I just type [Skype4COM.ISkypeEvents_Event] in my PowerShell console I get:
Unable to find type [Skype4COM.ISkypeEvents_Event]: make sure that the assembly containing this type is loaded.
However, I can get all the members of the $skype object:
$skype = New-Object -ComObject Skype4COM.Skype
The following line doesn't work:
$skypeevent = [Skype4COM._ISkypeEvents_Event]$skype
If I try to call the method directly on the $skype object, like this:
$skype.add_CallStatus({ write-host "yay" })
...it (as expected) tells me that:
Method invocation failed because [System.__ComObject#{b1878bfe-53d3-402e-8c86-190b19af70d5}] doesn't contain a method named 'add_CallStatus'.
I've tried to create a COM wrapper, but it still fails on getting the type for the COM interface...
Any ideas? Big thanks!