PowerCLI

 View Only
  • 1.  PowerCLI and Python

    Posted 19 hours ago

    So it may seem obvious, but installing PowerCLI, and trying to add a Depot - I have installed Python, and worked my way backwards in versions until 3.12.0, and STILL getting this error:

    Add-EsxSoftwareDepot : Failed to initialize the VMware.ImageBuilder PowerCLI module because of error: Unsupported
    Python version 3.12.0. Please upgrade to a higher version.
    Make sure that Python version 3.7.1 - 3.12 is installed and that you have set the path to the Python executable by
    using Set-PowerCLIConfiguration -PythonPath <executable_path>.

    Excutable path is set, and this is from the powershell session launched from the python session itself.



    -------------------------------------------


  • 2.  RE: PowerCLI and Python

    Posted 18 hours ago

    I got a little futher since posting this, I backdated my python installation to 3.11.6 and dinally got futher, then it complained there were missing modules in python:

    Missing Python
    modules. Make sure the following Python modules are installed: six, lxml, psutil, pyopenssl.

    To install these, I had to install ANOTHER python script, PIP, by finding and downloading get-pip.py as for some reason PIP was not working with the version of python installed.
    Collecting pip
      Downloading pip-25.2-py3-none-any.whl.metadata (4.7 kB)
    Collecting wheel
      Downloading wheel-0.45.1-py3-none-any.whl.metadata (2.3 kB)
    Downloading pip-25.2-py3-none-any.whl (1.8 MB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 6.8 MB/s eta 0:00:00
    Downloading wheel-0.45.1-py3-none-any.whl (72 kB)
    Installing collected packages: wheel, pip
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/2 [wheel] 
      Attempting uninstall: pip
        Found existing installation: pip 23.2.1
        Uninstalling pip-23.2.1:
          Successfully uninstalled pip-23.2.1
    Successfully installed pip-25.2 wheel-0.45.1

    I was then able to install the missing python modules:
    PS C:\Users\John.Howell\AppData\Local\Programs\Python\Python311\Scripts> .\pip install six
    Collecting six
      Downloading six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB)
    Downloading six-1.17.0-py2.py3-none-any.whl (11 kB)
    Installing collected packages: six
    Successfully installed six-1.17.0
    PS C:\Users\John.Howell\AppData\Local\Programs\Python\Python311\Scripts> .\pip install lxml
    Collecting lxml
      Downloading lxml-6.0.0-cp311-cp311-win_amd64.whl.metadata (6.8 kB)
    Downloading lxml-6.0.0-cp311-cp311-win_amd64.whl (4.0 MB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.0/4.0 MB 7.7 MB/s  0:00:00
    Installing collected packages: lxml
    Successfully installed lxml-6.0.0
    PS C:\Users\John.Howell\AppData\Local\Programs\Python\Python311\Scripts> .\pip install psutil
    Collecting psutil
      Downloading psutil-7.0.0-cp37-abi3-win_amd64.whl.metadata (23 kB)
    Downloading psutil-7.0.0-cp37-abi3-win_amd64.whl (244 kB)
    Installing collected packages: psutil
    Successfully installed psutil-7.0.0
    PS C:\Users\John.Howell\AppData\Local\Programs\Python\Python311\Scripts> .\pip install pyopenssl
    Collecting pyopenssl
      Downloading pyopenssl-25.1.0-py3-none-any.whl.metadata (17 kB)
    Collecting cryptography<46,>=41.0.5 (from pyopenssl)
      Downloading cryptography-45.0.5-cp311-abi3-win_amd64.whl.metadata (5.7 kB)
    Collecting typing-extensions>=4.9 (from pyopenssl)
      Downloading typing_extensions-4.14.1-py3-none-any.whl.metadata (3.0 kB)
    Collecting cffi>=1.14 (from cryptography<46,>=41.0.5->pyopenssl)
      Downloading cffi-1.17.1-cp311-cp311-win_amd64.whl.metadata (1.6 kB)
    Collecting pycparser (from cffi>=1.14->cryptography<46,>=41.0.5->pyopenssl)
      Downloading pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
    Downloading pyopenssl-25.1.0-py3-none-any.whl (56 kB)
    Downloading cryptography-45.0.5-cp311-abi3-win_amd64.whl (3.4 MB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.4/3.4 MB 7.2 MB/s  0:00:00
    Downloading cffi-1.17.1-cp311-cp311-win_amd64.whl (181 kB)
    Downloading typing_extensions-4.14.1-py3-none-any.whl (43 kB)
    Downloading pycparser-2.22-py3-none-any.whl (117 kB)
    Installing collected packages: typing-extensions, pycparser, cffi, cryptography, pyopenssl
    Successfully installed cffi-1.17.1 cryptography-45.0.5 pycparser-2.22 pyopenssl-25.1.0 typing-extensions-4.14.1

    And was FINALLY able to add the depot

    PS C:\Users\John.Howell\AppData\Local\Programs\Python\Python311\Scripts> Add-EsxSoftwareDepot -DepotUrl https://dl.broadcom.com/<TOKEN>/PROD/COMP/ESX_HOST/main/vmw-depot-index.xml
    WARNING: Please consider joining the VMware Customer Experience Improvement Program, so you can help us make PowerCLI a
     better product. You can join using the following command:

    Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true

    VMware's Customer Experience Improvement Program ("CEIP") provides VMware with information that enables VMware to
    improve its products and services, to fix problems, and to advise you on how best to deploy and use our products.  As
    part of the CEIP, VMware collects technical information about your organization’s use of VMware products and services
     on a regular basis in association with your organization’s VMware license key(s).  This information does not
    personally identify any individual.

    For more details: type "help about_ceip" to see the related help article.

    To disable this warning and set your preference use the following command and restart PowerShell:
    Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true or $false.

    Depot Url
    ---------
    https://dl.broadcom.com/<TOKEN>/PROD/COMP/ESX_HOST/main/vmw-depot-index.xml

    Was I just missing something in the initial setup? Becasue there is NOTHING about this in the VCF.PowerCLI instructions.

    -------------------------------------------