Skip to content

PowerShell

NOT_AUTHENTICATED Error with PowerCLI 13.1 - Cloud Director Authentication Changes

After updating PowerCLI to version 13.1, which has been released in April 2023, a couple of scripts that are using the Session Token provided by Connect-CIServer fail to work with the following error:

Invoke-WebRequest: {"minorErrorCode":"NOT_AUTHENTICATED","message":"[] This operation is denied.","stackTrace":null}

According to the official announcement, there have been changes to the authentication mechanism of Connect-CIServer. This change does not affect any functions that come with PowerCLI, but many community functions and scripts that include custom API calls.

In previous versions, you could simply snatch the authentication token that is stored in the $global:DefaultCIServers.SessionId global variable and use with an x-vcloud-authorization header in your custom API calls. Since PowerCLI 13.1, you now get a Bearer Token as SessionId/SessionSecret.

Read More »NOT_AUTHENTICATED Error with PowerCLI 13.1 - Cloud Director Authentication Changes

How to Install PowerCLI 13 with Python 3.7 on Windows (Required for ImageBuilder)

With the release of PowerCLI 13, VMware has introduced some major enhancements. One of the most exciting features is that PowerCLI is now fully Multi-platform, which means that all functions are available for all PowerShell Core supported operating systems including Windows, macOS, and Linux. If you are planning to use the ImageBuilder module, you will need to have Python 3.7 installed on your machine.

If you want to use ImageBuilder-based commands in PowerCLI 13, you might see the following error:

Add-EsxSoftwareDepot: Could not initialize the VMware.ImageBuilder PowerCLI module. Make sure that Python 3.7 is installed and that you have set the path to the Python executable by using Set-PowerCLIConfiguration -PythonPath. See the PowerCLI Compatibility Matrixes for information on the Python requirements.

This article explains how to install and configure PowerCLI 13 with Python 3.7 to be ready to use ImageBuilder.

Read More »How to Install PowerCLI 13 with Python 3.7 on Windows (Required for ImageBuilder)

Introducing Simplified Deployment for VMware Cloud Director 10.2

With the release of Cloud Director 10.2, VMware aims to make the deployment easier and more robust with a new deployment UI that includes error-checking. In previous versions, you had to provide the initial configuration with vAPP options during the OVA deployment. When there was a problem, which was very common, especially with the NFS share, you had to redeploy the system. Redeploying the appliance multiple times was was very time-consuming.

In Cloud Director 10.2, the operation has been split into 2 stages, as you know it from the vCenter Server. You first deploy the OVA with some basic settings that are not error-prone and then log into a web interface to do the actual Cloud Director configuration like setting up the NFS share and create the Administrator Account.

This article does a quick review of the installation using my OVF Helper Scripts and the new two-stage appliance system setup.

Read More »Introducing Simplified Deployment for VMware Cloud Director 10.2

ESXi on RPi - Create EEPROM and Firmware SD Card with PowerShell

The installation of ESXi on a Raspberry Pi using the ESXi on ARM Fling basically involves 3 steps:

  1. Patch RPi EEPROM to the latest version using an SD card. You can reuse the SD card in Step 2.
  2. Write RPi Firmware and EFI to an SD Card. This is the bootloader for ESXi and needs to remain in your RPis SD slot, even after ESXi installation.
  3. Install ESXi on ARM using a USB flash drive (This step is identical to x86 Hardware)

I've tried to make this sprocess unattended so I've created two PowerShell functions that automate Step 1 and 2.

Read More »ESXi on RPi - Create EEPROM and Firmware SD Card with PowerShell

Visual Studio Code Error "No match was found for the specified search criteria and module name PackageManagement"

Visual Studio Code asks to perform an update when launching the PowerShell Integrated Console. The Update fails with the following error message:

PS> powershell.exe -NoLogo -NoProfile -Command 'Install-Module -Name PackageManagement -Force -MinimumVersion 1.4.6 -Scope CurrentUser -AllowClobber'

PackageManagement\Find-Package : No match was found for the specified search criteria and module name 'PackageManagement'. Try Get-PSRepository to see all available registered module repositories.

Get-PSRepository returns the following error:Read More »Visual Studio Code Error "No match was found for the specified search criteria and module name PackageManagement"