VMware {code} Community
JohnnyLi
Contributor
Contributor

C# Version of Invoke-VMScript

Hi, all.

I've been using PowerCLI cmdlets for a few months, but am now switching over to the vSphere SDK in C#. It's a vastly different interface and I would really appreciate some help with finding out equivalent "operations" in the SDK that are in PowerCLI.

Is there anyone here that can show me how I can do something simliar to Invoke-VMScript (running a script within a virtual machine's operating system)? If there isn't a way do it natively, can I get some help as to any extensions I can use?

0 Kudos
2 Replies
njain
Expert
Expert

You won't be able to use vSphere Webservices SDK to run a program inside Guest OS. You can use VIX APIs instead, which provides APIs to run programs/scripts inside the VM.

https://www.vmware.com/support/developer/vix-api/

You can refer to VixVM_RunProgramInGuest() and VixVM_RunScriptInGuest() functions.

Hope this helps,

Neha

JohnnyLi
Contributor
Contributor

Thank you.

0 Kudos