1

Is there by any chance a posibility to create a reference to an Interface ID Directly.

I tried something in a syntax form like but didnt work ...

$CO = new-object -ComObject "System.__ComObject#{fafa4e17-1ee2-4905-a10e-fe7c18bf5554}"

This Interface id is from Virtualbox.VirtualBox itself I know that I can reference it with VirtualBox.VirtualBox naturally.

Can you refernce interface ids directly .... ?? As long the Interface is Public I Think you can but i cant find any example . ??

Thanks:)

1 Answer 1

2

I found the solution to my own problem by accessing it through:

[System.Runtime.InteropServices.Marshal]::GetTypeFromCLSID('fafa4e17-1ee2-4905-a10e-fe7c18bf5554')

OR:

$Type = [Type]::GetTypeFromCLSID('fafa4e17-1ee2-4905-a10e-fe7c18bf5554')
$Vbox = [System.Activator]::CreateInstance($Type)
$Vbox.APIVersion

This answered my question; case closed :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.