Attempts to get all image profiles might fail while running the Get-EsxImageProfile command in vSphere PowerCLI
search cancel

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

book

Article ID: 339909

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • 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



Environment

VMware vSphere ESXi 5.5
VMware vSphere ESXi 5.1
VMware vSphere ESXi 5.0

Resolution

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: