Home > Powershell, Toolbox, VMWare > Script of the Day – quick and easy VMware Powershell scripts

Script of the Day – quick and easy VMware Powershell scripts

Today’s script of the day is more a collection of scripts (or rather an easy way of generating a bunch of scripts)

Over at the VMware labs (http://labs.vmware.com/) they have released an awesome tool (in Alpha at the moment) that interecepts instructions sent to your Virtual Center and in the background generates PowerCli (or javascript or C# or Soap) code for you.

This of course is not a replacement for your existing scripting skills, but rather a method of generating code (by using the GUI) and then being able to figure out what you want to work with and edit / recycle that bit of code.

To use Onyx, is relatively simple.

Firstly, download the binaries and install the tool:


From the dropdown, sleect you preferred output type and click the little yellow star on the left.

You now need to specify the address of your vCenter, select your script environment and authenticate. In my case I chose PowerCli and the window popped up, ready to go. (loaded my profile etc, so watch out if your profile already connects to the VC, as you may end up with multiple connections and in effect duplicate any instructions that you run)

Next thing to do is launch your Client and authenticate, but point the client at yourself

It is important that you point to HTTP://localhost:1545 as the Onyx client is listening on HTTP port 1545. If you do not do this, it simply will not work.

(effectively, Onyx is going to capture your movements and redirect them to the VC.)

Now, within your VC, go ahead and make changes to your environment.

If you now go back to Onyx, you will see a list of of instructins, reflecting the PowerCli code for the changes you have made – Magic!

  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.