Currently – 7/23/17 – Powershell Beta 4 and PowerCLI 1.10 are not compatible. But hopefully soon they will. But since I want this to work now, we are going to get it working in a Docker container. Thanks to Steve for the idea. I learned what to do between William Lam in this article, and the Docker site.

Docker

We get the Mac docker image from here. I am using the Community Edition.

Once we get the Docker image downloaded and double-click on it we see an easy install.

So we then start Docker (double + click on it in the Applications folder.

Next we see….

Next we see….

So now we start our Terminal app. And we try a few commands.

PowerCLI

From our Terminal, we use the following command to install PowerCLI.

docker pull vmware/powerclicore

And it does not take long to finish.

Now we need to run the PowerCLI Core Docker Container.

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

So we try a few commands. First:

Get-Module -ListAvailable PowerCLI*

Followed next by:

Connect-VIServer -server Lefroy.thewhites.ca

To help with the cert error you can use this command:

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

Now we can connect to our vC again.

Connect-VIServer -server Lefroy.thewhites.ca

If you exit your terminal, and go in again, and start PowerShell you will be able to use PowerCLI fine. Docker starts when you restart your computer and so you will be good. But, if you quit Docker you won’t have PowerCLI. If you start Docker again, you need to run the following command:

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

You will not have easy access to your scripts and so William has some examples of how to make them work in this article. I wonder if there is an editor that I could find and than use copy and paste to it? I think more work will be need to be done on this and for now will have to do interactive stuff.

BTW, I did not create a Docker account. Not sure if I need to or not.

Once I figure out a good way to get access to my scripts I will add it to this article.

Questions or comments, let me know,

Michael

=== END ===