I need to write a Windows PowerShell script to deploy a Linux VM from a template, assign the network adapters to particular networks, start the VM, copy some files to the VM, execute a script on the VM, and copy files back from the VM. (Note that at the time that we need to copy the files and start the scripts, the NICs on the VM are not yet fully configured, so the VM cannot be reached over the network through SSH.)
My impression is that all these functions can be accomplished through VIX, but it is not obvious how best to use VIX from PowerShell.
1.One of my coworkers has been calling vmrun.exe from PowerShell, but vmrun.exe is actually intended as a command line interpreter for VIX, not as an API for script callers.
2. It appears that the COM interface to VIX should be usable from PowerShell, but I can't find any example scripts that do this. My best hope along these lines is to take the VMScript example from the VIX SDK and try translating it into a PowerShell script.
3. Then I found a blog entry at http://blogs.vmware.com/vix/2008/12/call-vix-more-easily-from-net-plus-powershell-goodness.html that suggests using a wrapper library that someone wrote to make it easy for .NET clients to talk to VIX. But I don't want to get involved in the legalities of redistributing or reimplementing this library, and I also don't understand why it would be better than just using the COM interface to VIX.
I don't have much time to implement this, so I'll have to go with the kludge of calling vmrun.exe unless I can quickly find an alternative.
Thanks for any suggestions! Josephhttp://blogs.vmware.com/vix/2008/12/call-vix-more-easily-from-net-plus-powershell-goodness.html