Monthly Archives: October 2016

PowerCLI Core

When Microsoft and Jeffrey Snover released PowerShell on Linux a few months back we knew PowerCLI running on Linux wasn’t too far away. ¬†Well, an awesome demo from Alan Renouf running PowerCLI in a Docker container was probably a giveaway ūüôā

Well since then we’ve been patiently waiting,¬†and¬†hearing rumors of a Fling, for the release. ¬†Earlier this week VMware finally released that Fling. ¬†And that haven’t disappointed. ¬†VMware have provided a number of different methods to run PowerCLI Core --OS X, Linux, and Docker. ¬†Skimming through the Instructions PDF on the Flings site by far the easiest method has to be the Docker image from Docker Hub (assuming you already have docker installed).

I decided to try out this docker image and was pleasantly surprised at how easy it was. ¬†Boy, I miss the old days of Linux where I had to compile and install everything, then troubleshoot, and repeat. ¬†Using an Ubuntu 14.04 build it’s as simple as running two commands.

First pull down the docker image from Docker Hub.

docker pull vmware/powerclicore

Then run the container!

docker run --rm -it --entrypoint=’/usr/bin/powershell’ vmware/powerclicore

And that’s really it, kind of. ¬†There is one more command you’ll have to run to actually connect to a vCenter or ESXi host. ¬†Without it you’ll receive an Invalid Certificate error which will prevent you from connecting.

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

After that you should be able to connect as normal to a vCenter.

ubuntu01-vmware-workstation-000303

As the doco states not all the modules are available yet.  Currently just the Core and VDS cmdlets.  A quick check shows we have 315 available to us.  Which, to be honest, is a huge amount.

PS /powershell> (get-command -Module powercli*).count
315

I haven’t done too much with it yet. ¬†Though I have already noticed a few odd issues and errors. ¬†It’s hard to say if it’s PowerCLI Core related or PowerShell. ¬†One notable issue is when pipping a PowerCLI cmdlet multiple times on the command line it would intermittently fail.

The important thing to note here is this is a Fling, which as I’ve mentioned before, is unsupported and comes with no guarantees. ¬†Not only that but it’s build upon an Alpha build of PowerShell 6. ¬†Put it together and sure you’ll probably get unexpected results sometimes.

Never the less this is another get testament to VMware’s commitment to PowerCLI and PowerShell. ¬†I’m excited to see PowerShell and PowerCLI continue to further develop and mature on Linux and open the door to a whole new slew of developers.

References

PowerCLI Core Fling
VMware PowerCLI Blog Announcement