The much anticipated PowerCLI Core was just released this week as a VMware Fling which allows you to run PowerCLI on Linux, Mac OS X or even as a Docker Container. This is HUGE if you ask me, especially for customers who would like the benefits of PowerCLI and not be forced to use a Windows system which it traditionally had required.
I personally have been using PowerCLI Core for quite some time now on my Mac OS X and the experience is exactly the same as you would find it on its Windows counterpart. The Docker Container is also a another great way to consume PowerCLI Core and I also use that quite frequently as well. One thing I felt that would make the Docker Container even easier to consume for those looking to do something really quick in PowerCLI or what I call "Just In time PowerCLI access" is to be able to quickly pull it down from Docker Hub rather than having to download bunch some files and then manually build it yourself (not that it is complicated) but sometimes speed is the game.
I had posted a tweet earlier this morning and literally a few hours later, my good friend Alan Renouf delivered the goods! In addition, you will also find that the new version of PowerCLI Core Docker Container is now using Photon OS image rather than Ubuntu as it previously did.
Asked for @PowerCLI Core to be hosted on @Docker Hub & the MAN (@alanrenouf)) delivers!
docker pull vmware/powerclicore pic.twitter.com/4VpoDZJNc9
— William Lam (@lamw.bsky.social | @*protected email*) (@lamw) October 19, 2016
In addition to the three methods of consuming PowerCLI Core, you also now find it hosted on Docker Hub: https://hub.docker.com/r/vmware/powerclicore/
UPDATE (01/03/17) - It looks like PowerNSX is now also included with PowerCLI Core. To use PowerNSX, simply import it by running the following command: Import-Module PowerNSX and you will now have access to the PowerNSX cmdlets! Nice job to the PowerNSX guys for making this possible for our customers!
To access PowerCLI Core from Docker Hub, you simply just need a system installed with the Docker Client (Windows, Linux or Mac OS X) running or you can even use VMware's Photon OS which comes with Docker by default and following the instructions below:
Step 1 - Pull the PowerCLI Core image from Docker Hub by running the following command:
docker pull vmware/powerclicore
Step 2 - Run the PowerCLI Core Docker Container by running the following command:
docker run --rm -it --entrypoint='/usr/bin/powershell' vmware/powerclicore
It is literally that easy to access PowerCLI from ANY platform at ANY time! 😀
Step 3 - If you are using a self-signed certificate, you will need to run the following command below before you can call the Connect-VIServer cmdlet:
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
I applaud this effort, but would like more choices in programming languages. Do you know if VMware is working to provide a rest api for all the vsphere functions? That way, we could do rest api in the language of our choice.
Kevin,
Yes, we are! Please have a look at the VMworld Session Alan and I did at VMworld US for more details 🙂 http://vmware.mediasite.com/mediasite/Presentation/9b61593fdc5646d390be355097f7177744/f0b0e19defb64e008689a6fadf0266941d
Awesome!! Love the direction VMware is going with this!!
Thank you very much vor this incredible good blog post =)
Hi William,
thank you very much for this post! I'm using the powercli with mit Mac OS since I read this.
I only got one problem. After the last docker pull I got often following error "An error occurred while sending the request.".
First I thought that this is a problem with the ssl certificate but I ignore all messages with "Set-PowerCLIConfiguration -InvalidCertificateAction Ignore".
Can you help me?
very cool. now to learn enough about PowerCLI so I can automate ignoring certs and connecting to a server
For those wondering, OK I have a powershell cli running, how do I do something useful like write a script: The pwsh is running in Photon, so type sh and you will get a shell. Then you can do all the unix stuff you need to do like install vim, etc. Exit the shell and voila, you have vim in your pwsh. Be sure to commit your customized docker image when you're done customizing....
Can you use SSO or CredentialStore yet please?