Please feel free to provide feedback or file bugs here.

WMF 5 - Invalid callee when using variant wrapper

If I use the Runtime.InteropServices.VariantWrapper in WMF5 I get errors trying to interact with the system center orchestrator 2012 com object.. (x86)

IE if I do this without WMF5:

$oisMgr = new-object -com OpalisManagementService.OpalisManager
$oHandle = New-Object Object
$handle = New-Object Runtime.InteropServices.VariantWrapper($oHandle)
$oisMgr.Connect($Username, $Credential.Password, [ref]$handle)

It works fine, if I run with WMF5 I get an Invalid Callee Error.

OS is windows 2012.. thinking about it as I write this, has the 'Object' type changed at all between the two?

2 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

    David WallisDavid Wallis shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    To be honest PowerShell historically does not handle variants particularly well. We may have regressed in this area, which would be bad, so we have question and some pointers to articles that may help.

    Can you give us the information in $PSVersionTable, please?

    There is a good article in StackOverflow that talks about using Variants and offers some suggestions: http://stackoverflow.com/questions/30512785/retrieving-session-id-from-com-method

    One of the better suggestions is in a link from that article: http://www.archivum.info/microsoft.public.windows.powershell/2010-01/00361/RE--quot-Invalid-callee-quot--calling-a-com-object.html. While the content is valuable, I will apologize in advance for the ad placement on that page :-(

    3 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base