HOWTO: Create a Custom VMware vSphere 6.x ESXi Image using PowerCLI

As part of the continual (re)deployment and evolution of my home lab I have created a custom ESXi image to include a VIB for my Synology SAN. Whilst I will concentrate on the steps required to complete this specifically for the Synology, the principle applies to any home lab or indeed any Production environment that needs a custom VMware vSphere ESXi Image.

I try to be structured when it comes to scripting and this sort of thing, so I have create a folder structure which I will share, therefore the following steps assumes you have downloaded the necessary ZIP files into a folder called c:\homelab\esx.Note: I use Windows 10, so if you use another variant or Mac OS the steps maybe subtly different.

Steps for creating a New Custom ESXi Image

Open PowerCLI

Go to the folder containing the downloaded ZIP/VIBs, in my instance this is the ESX folder using cd c:\homelab\esx

Note: As part of the PowerCLI session, If you have already created a custom image with the name you want to use (i.e. you have created a new image and decided to add some more custom VIBs to it), you can see the Get-EsxImageProfile cmdlet to view current image profiles

And you will need to remove it first by running Remove-EsxImageProfile -ImageProfile <name of profile to remove>