In VMware automation, PowerCLI 13 is a powerful toolset that brings new capabilities, especially with the ImageBuilder module that lets you customize ESXi images. Since PowerCLI 13, a key requirement has been introduced. ImageBuilder now relies on Python 3.7 or later, making setup a bit more involved but still straightforward. If you want to build custom ESXi images on Windows using PowerCLI’s ImageBuilder,
With VMware PowerCLI ImageBuilder, you can customize ESXi installation ISOs easily.
This article will help you install, configure, and integrate PowerCLI 13 with Python 3.7 on your Windows machine easily.
Table of Contents
ToggleWhy PowerCLI 13 with Python 3.7?
PowerCLI 13 improves support for multiple platforms, including Windows, macOS, and Linux. The ImageBuilder feature now allows users to create custom ESXi installation ISO images and relies on an external Python runtime. You need to install Python 3.7 or later, along with extra Python modules, for the ImageBuilder commands to work correctly. If Python is not set up, commands like Add-EsxSoftwareDepot will generate errors like:
Could not initialize the VMware.ImageBuilder PowerCLI module. Make sure Python 3.7 is installed and the path is set.
This new requirement improves flexibility but requires a few extra installation steps in Windows environments.
PowerCLI Python requirement was introduced in version 13 for better cross-platform compatibility
Install and Configure PowerCLI and Python on windows step by step
Step 1: Install PowerCLI 13 on Windows
- Launch PowerShell as Administrator.
- Run the following command to install the latest version of PowerCLI from the PowerShell Gallery: add -Force parameter if you have other version of powercli installed
Install-Module -Name VMware.PowerCLI -Scope CurrentUser
If prompted about an untrusted repository, press Y or A and Enter to confirm.
- If you have already lower version of PowerCLI installed and you want to install PowerCLI 13 then run this command
Install-Module -Name VMware.PowerCLI -Scope CurrentUser -Force -SkipPublisherCheck
- Verify the installation and list installed modules:
Get-Module -ListAvailable VMware.PowerCLI, VMware.ImageBuilder | Select Name, Version, Path | Format-List
PowerCLI 13 includes ImageBuilder. However, it will not function properly unless Python is set up.
Step 2: Install Python 3.7 on Windows
- Download the executable installer for Python 3.7.9 (latest compatible version) from official Python release page:
https://www.python.org/downloads/release/python-379/ Run the installer ensuring:
You choose Add Python 3.7 to PATH during installation.
You install it for your user or system (note the install path).- Confirm Python installation by opening a new Command Prompt or PowerShell session and running:
python --version
- You should see output similar to:
Python 3.7.9
- Make a note the exact path to python.exe by running:
where python
- Example output:
C:\Users\[username]\AppData\Local\Programs\Python\Python37\python.exe
Make sure the Python directory is in the system environment PATH so it can be accessed globally.
Step 3: Install Required Python Modules
Download the get-pip.py script from:
https://bootstrap.pypa.io/get-pip.py- Run this script with Python to install pip:
python get-pip.py
- Use pip to install the required modules:
pip install six psutil lxml pyopenssl
These packages are necessary for PowerCLI ImageBuilder to work.
Step 4: Configure PowerCLI to Use Python
Let PowerCLI know where Python 3.7 is installed, run:
Set-PowerCLIConfiguration -PythonPath "C:\Users\[username]\AppData\Local\Programs\Python\Python37\python.exe" -Scope User
Replace the path with your actual Python executable location from Step 2.
You can verify the configuration by running:
Get-PowerCLIConfiguration -Scope User | Select PythonPath
Restart PowerShell after this step to ensure changes take effect.
Step 5: Validate ImageBuilder Functionality
Now test the ImageBuilder module by running a command such as:
Get-EsxImageProfile
If the command successfully lists image profiles, ImageBuilder is properly configured with Python.
You can proceed to create custom ESXi images, for example by adding depots, cloning profiles, and exporting custom ISO images.
Tips for Smooth Setup:
- Always run PowerShell as Administrator when installing modules and configuring.
- Ensure your PowerShell execution policy allows script execution:
Get-ExecutionPolicy
- Set it to at least RemoteSigned if needed:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
- If using Windows Terminal or PowerShell Core, the steps remain identical.
- Keep your Python and PowerCLI versions compatible; ImageBuilder in PowerCLI 13 specifically requires Python 3.7 series.
Conclusion
Setting up PowerCLI 13 with Python 3.7 on Windows opens up strong automation options through the ImageBuilder module for customizing ESXi images. Although the extra Python requirement adds a few more installation steps, this article helps you customize ESXi images with PowerCLI quickly and reliably. Whether you are an IT professional creating ESXi images or a developer automating VMware tasks, this setup will help you achieve your goals with a reliable and forward-compatible foundation
FAQs
Q1. Why does PowerCLI 13 require Python 3.7?
PowerCLI 13 introduced a Python dependency for the ImageBuilder module. Python 3.7 or later is needed to run commands like Add-EsxSoftwareDepot for customizing ESXi images.
Q2. How to install PowerCLI 13 on Windows?
Open PowerShell as Administrator and run:
Install-Module -Name VMware.PowerCLI -Scope CurrentUser -Force -SkipPublisherCheck
This installs the latest PowerCLI 13 with ImageBuilder support.
Q3. How do I configure PowerCLI to use Python 3.7?
Run the following command with the correct Python path:
Set-PowerCLIConfiguration -PythonPath "C:\Path\To\Python37\python.exe" -Scope User
Restart PowerShell to apply the configuration.
Q4. What Python modules are required for ImageBuilder?
Install the following modules with pip:
pip install six psutil lxml pyopenssl
These ensure the PowerCLI ImageBuilder module works without errors.
Q5. How to verify ImageBuilder is working in PowerCLI 13?
Run:
Get-EsxImageProfile
If image profiles are listed, ImageBuilder is correctly configured with Python 3.7.


