build-vmHostImage v0.2

The script has been modified to exclude certain vibs. The reason is that with some configurations we found out that the wrong vib was loaded on a vspherer host. Resulting in a PSOD, due to driver, hardware, ESXi version conflicts.

With this in mind, I added the functionality to exclude VIBs. The excluded VIBs are listed in the parameters.ps1 file.
After the new image profile has been configured, the script will exclude the VIBs, if they are present. VIBs that are excluded are reported in excluded.txt file.

The script creates a parameters.ps1 file in the project folder, containing the names of the Vibs that are excluded. This file is used to re-create an image if necessary.

You can find the script at github, here

Loading PowerCLI one-line

Finaly 🙂
You can load PowerCLI with a one-liner again.
Why ? well… PowerCLI 6.5 is only moduled based, while the previous versions where a mix off snappins and modules.
When it was mainly snappin bassed I used a one-liner like:

get-pssnapin -registered vmware* | add-pssnappin

When PowerCLI was module and snappin based, I used a custom PowerShell function import-PowerCLI (see my previous post https://vblog.bartlievers.nl/2016/11/22/import-powercli/ for details). But with PowerCLI 6.5 R1 you can use a one-line once again.
This one-line is :

> Get-Module -ListAvailable vmware* |Import-Module