VMware with PowerShell on macOS

Part of my job responsibilities are managing a large VMware installation and a tool which I use frequently, is PowerShell with the VMware modules. The following is only how I installed it on macOS and is by far not the only way.

First, I use Brew, it just makes things easier for me to get all the tools that I require and keep them up to date easily. Click here if you could like to know how to install Brew.

Installing PowerShell via Brew

Installing PowerShell via Brew is very easy and can be done via a simple command:

brew cask install powershell

Once this is complete you can access PowerShell in one of two different ways. The first is once the installation is complete you’ll have a PowerShell icon in your applications folder. However, the easier way to access PowerShell will be via Terminal and typing:

sudo pwsh

Installing VMware modules into PowerShell

Next we will install the VMware modules, which is why we’re putting sudo in front so that we’re working as an Administrator.

sudo pwsh

Find-Module -Name VMware.PowerCLI

Install-Module -Name VMware.PowerCLI -Scope CurrentUser

Now let’s verify that everything got installed

Get-Command -Module *VMWare*

If everything went as expected you’ll see a long list of VMware modules.

Connecting to your vCenter

Connect-VIServer -Server vcenter.host.local -User administrator@vsphere.local -Password

So, now what?

For more detailed documentation that what’s found here, click this link.

To get a list of all your virtual machines:

get-vm

If you want to see a lot more information about each machine you can have that information spit out in a nice format list, like this:

get-vm | fl

A common task is moving virtual machines from here to there as users believe that memory and CPU are infinite. The following command would move the VM to the new ESXi host, via vMotion:

Move-VM -VM 'vmname' -Destination 'newesxi host'

The point of this post was to get everyone up and running on macOS with PowerShell and VMware. There are many resources on-line that will help you continue your journey.

Go Beyond

“If you feel yourself hitting up against your limit remember for what cause you clench your fists… remember why you started down this path, and let that memory carry you beyond your limit.”

All Might “My Hero Academia”

A Couple of Jokers

I collect Funko POP figures and have been waiting a long time for a version of The Joker from the 1989 Batman film. This time around I decided to try my chances by ordering more than one from Amazon in hopes of getting the rare Chase version of the figure.

To my amazement, this actually worked and I got one of each. The Chase version is the one on the right, with his makeup coming off. The chances of finding this one a shelf are insanely rare as they are quickly picked up, much of the time, by people that then sell them on eBay for 3x the original price.

Secret

“Making something secret makes it too important, elevates it to the point where it runs your life from the shadows. If you hide what’s at your core from other people for too long, sooner or later you end up hiding it from yourself and waking up with no idea of who you are.” 

 Michael Marshall Smith

« Older Entries Recent Entries »