I have been using Powercli for more than 2 years. I wrote some scripts that helped me a lot in getting things automated. Powercli may be optional for some use cases however, there are also some other cases that cannot be done without using Powercli. One of these cases is ImageBuilder which allows admins to create a customized image to be used later for ESXi server deployment.
ImageBuilder is very easy to use. You will just add a software depot using Add-EsxSoftwareDepot command and then you should be able to get all the Images using Get-EsxImageBuilder command.
I am running Powercli 5.5 r2 on Windows 2008 R2 (x64).
A recent problem I found when I tried to run Get-ESXImageProfile, I received the below error:
That was something expected for me as it has been mentioned as a known issue in Powercli 5.5 r2 Release notes (Here)
When you run the Get-EsxImageProfile command using vSphere PowerCLI to get all image profiles, an error similar to the following is displayed:
PowerCLI C:\Windows\system32> Get-EsxImageProfile
Get-EsxImageProfile : The parameter 'name' cannot be an empty string.
Parameter name: name
At line:1 char:20
+ Get-EsxImageProfile <<<<
+ CategoryInfo : NotSpecified: (:) [Get-EsxImageProfile], ArgumentException
+ FullyQualifiedErrorId : System.ArgumentException,VMware.ImageBuilder.Commands.GetProfiles
Workaround: Run the Get-EsxImageProfile -name "ESXi-5.x*" command, which includes the -name option and display all image profiles created during the PowerCLI session.
For example, running the command Get-EsxImageProfile -name "ESXi-5.5.*" displays all 5.5 image profiles
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> Get-EsxmageProfile -name "ESXi-5.5.*"
Name Vendor Last Modified Acceptance Level
---- ------ ------------- ----------------
ESXi-5.5.0-20140701001s-no-... VMware, Inc. 8/23/2014 6:... PartnerSupported
ESXi-5.5.0-20140302001-no-t... VMware, Inc. 8/23/2014 6:... PartnerSupported
ESXi-5.5.0-20140604001-no-t... VMware, Inc. 8/23/2014 6:... PartnerSupported
ESXi-5.5.0-20140401020s-sta... VMware, Inc. 8/23/2014 6:... PartnerSupported
ESXi-5.5.0-20131201001s-sta... VMware, Inc. 8/23/2014 6:... PartnerSupported
So I tried the above instructions however this did not solve the issue. I searched the community with the error I have and I found a relevant thread (here)
Special thanks to Alan Renouf (@alanrenouf) and Luc Dekens (@LucD22) for giving a help , So the way this worked for me was to change the deport url to: Add-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/TEST/main/vmw-depot-index.xml
Then run the command: Get-ESXImageProfile with -name parameter added as shown below: