Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6715037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:33:58+00:00 2026-05-26T08:33:58+00:00

Long time stackoverflow reader, first time poster. Forgive me if I’m not asking a

  • 0

Long time stackoverflow reader, first time poster. Forgive me if I’m not asking a question correctly.

I’m trying to use the VixCOM API with PowerShell. I don’t have much experience with either. I am aware of VMWareTasks: C# VixCOM wrapper library & tools . I’ve used it with success, but would like to use the VixCOM API directly for reasons I don’t want to get into at the moment. I may end up using the VMWareTasks wrapper, but humor me while I try to understand the issue at hand.

My script is:

$vixLib = New-Object -ComObject VixCOM.VixLib
$job = $vixLib.Connect(-1, 10, "https://esx-server/sdk", 0, "admin", "password", 0, $null, $null)

When I run this script from PowerCLI, I get an error:

Exception calling "Connect" with "9" argument(s): "Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))"
At D:\dev\PowerShell\Automated Deploy\UsingVixCOM.ps1:11 char:23
+ $job = $vixLib.Connect <<<< (-1, 10, "https://esx-server/sdk", 0, "admin", "password", 0, $null, $null)
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ComMethodTargetInvocation
  • Which parameter is causing the type mismatch?
  • What is the proper way to call the Connect method?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:33:59+00:00Added an answer on May 26, 2026 at 8:33 am

    It seems like the last two parameter types are mismatched.

    To display the methods and parameter types of an object call the Get-Member CmdLet like this:

    $vixLib = New-Object -ComObject VixCOM.VixLib
    
    $vixLib | get-member
    

    Returns:

    TypeName: System.__ComObject#{94eaa428-2460-470d-8f66-2a4270aff20a}  
    
    Name                  MemberType Definition  
    ----                  ---------- ----------  
    Connect               Method     IJob Connect (int, int, string, int, string, string, int, IVixHandle, ICallback)
    

    You may then try to:
    1. Import Interop.VixCOM.dll to get the interface types
    2. Create a new class that inherits from IVixHandle
    3. Create a new class that inherits from ICallback
    4. Create two new instances of each of the two new classes
    5. Pass those objects to the Connect method

    You may need to use the get-interfaces cmdlet found on the Workarounds tab here:
    https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=249840&SiteID=99

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey there, I'm a first time stackoverflow poster, long time reader. I'm dipping the
I'm a long running fan of stackoverflow, first time poster. I'd love to see
(Long time reader of SO, first time asking a q. I'm quite new to
Long time reader, first time poster. Any help is greatly appreciated. I have crafted
Hey! First post for me but long time reader of Stackoverflow. Anyway, got a
Well this is not the first time im asking these question here but I
Long-time joelonsoftware follower, 1st-time stackoverflow poster. I want to know how safely I can
I am new to Python and this is my first time asking a stackOverflow
My 1st question here on stackoverflow. I am trying to print a long grid,
Long time lurker of stackoverflow and just trying something with iframes and jquery which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.