Search the VMware Knowledge Base (KB)
View by Article ID

Attempts to get all image profiles might fail while running the Get-EsxImageProfile command in vSphere PowerCLI (2089217)

  • 11 Ratings

Details

  • Attempts to get all image profiles fail while running the Get-EsxImageProfile command using vSphere PowerCLI
  • You see an error similar to:

    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

Solution

To work around this issue, close and reopen the PowerCLI session and run the Get-EsxImageProfile -Name "ESXi-5.x*" command, which includes the -Name option to view a list of all ESXi 5.x image profiles created during the PowerCLI session.

For example, running the command Get-EsxImageProfile -Name "ESXi-5.5.*" displays all ESXi 5.5 image profiles similar to these:

PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> Get-EsxImageProfile -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


You can assign the results of Get-EsxImageProfile with the -Name option to variables, and append the variables to get all image profiles similar to these:

PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $55_imageprofile = Get-EsxImageProfile -name "ESXi-5.5.*"
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $51_imageprofile = Get-EsxImageProfile -name "ESXi-5.1.*"
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $50_imageprofile = Get-EsxImageProfile -name "ESXi-5.0.*"
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $all_imageprofile = $55_imageprofile + $51_imageprofile + $50_imageprofile
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> $all_imageprofile


Note: The last command lists all the image profiles in the software depot.

Additional Information

For translated versions of this article, see:

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.

Feedback

  • 11 Ratings

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.

What can we do to improve this information? (4000 or fewer characters)




Please enter the Captcha code before clicking Submit.
  • 11 Ratings
Actions
KB: