Virtualization Pro

Feb 18 2009   4:45PM GMT

PowerShell is for Windows and Linux developers

Texiwill Edward Haletky Profile: Texiwill

I have had several major issues with PowerShell (and still do), but that was mainly due to lack of cmdlets rather than lack of PowerShell functionality. So am I now one of the converted, given VMware’s integration with PowerShell? Yes and no.

Yes, because to me, PowerShell is just another scripting language.

No, because I want a scripting language that works well on all operating systems.  (People will suggest Java, but that is another blog post.)

I wrote a Perl application that would log in to an ESX host, run an assessment of its configuration and from there aid me in judging the security of the host and some smaller parts of the virtual environment. Since it was written in Perl, it would be hard to get people to use excepting myself and other Perl users. This breed is found mostly within the Linux world; many VMware infrastructure administrators may not understand Perl well as it comes with a learning curve.

So I went looking at various other tools and discovered PowerGUI. PowerGUI is a great tool that has PowerPacks of prewritten PowerShell cmdlets that can run within the GUI.

There is a PowerPack for the VMware Infrastructure Toolkit, Hyper-V and Xen. The idea is to present a graphical interface for PowerShell cmdlets. This is just the interface I wanted for my tool, something I could plug into with ease to present the information in a way my users would easily understand with very little fuss. For them, it just has to work easily.

Unfortunately, PowerShell did not have the major facility I needed to make this work. It does not natively support secure shell and Expect functionality. Expect functionality allows a script to wait for predetermined output from a log-in session (or any other session) that often requires a password . Expect is a very valuable addition to any Linux programmers toolbox.

After posting my questions to the PowerShell channel on, I received some answers to my simple PowerShell programming questions. I also used Google searches to find how specific objects worked within PowerShell versus pre-existing cmdlets.  Jaykul, a helpful participant on the irc channel, went even further to assist me by developing a set of SSH routines using the SharpSSH client written in .NET that actually has embedded Expect functionality. This type of assistance within a scripting community is outstanding. It shows that the backers really want PowerShell to be a success, and that Powershell can make use of any .NET library on a system.

This, combined with help from PowerGUI guru Scott Herold, will allow me to plug my tool into the PowerPack for VMware Virtualization as an action that can run on each ESX host or cluster as needed. This also implies I can worry about the guts of the code and leave the UI to someone else entirely.

After combining PowerGUI, the VMware Infrastructure Toolkit PowerPack and Jaykul’s Scritable SSH cmdlets I was off and running. My tool works for me and should be easy to understand for others, meaning it will work without tweaking and very few downloads, namely just As in it JUST WORKS with no twiddling and very few downloads, namely PowerShell and perhaps PowerGUI.

So as a long time Linux-centric developer, I have finally found a scripting language for Windows that works well. It is missing functionality that I am used to, but the community is extremely active and very helpful.  For additional help, check out the Get Scripting Powershell podcast .

There are great scripts for the PowerShell version of the VMware Infrastructure Toolkit, and the list is growing daily. Be sure to bookmark Alan Renouf’s vDiagram script and his blog Virtu-AI. You’ll find  many blog posts on PowerShell tools and links to useful scripts.

Now if they could make PowerShell run on Linux and Mac systems!

1  Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.
  • Halr9000
    Alan's stuff is great, as is the podcast on which he co-hosts. Also check out the [A href=""]VMware Community forums[/A] and [A href=""]document store[/A] for the VI Toolkit. That's where Alan, myself, LucD, Hugo, and a bunch of other great contributors share their knowledge and anyone can get their questions answered. I also post about VI PowerShell stuff on [A href=""]my blog[/A], and of course I'm writing [A href=""]the book[/A] which is due out in a month or so. Last, but not least, we've interviewed Carter Shanklin twice now on [A href=""]the podcast[/A]. He is the product mgr at VMware responsible for the toolkit.
    0 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: