0

I am trying to retrieve the value of software.acceptance for EsxCli using the command:

$AcceptLevel = (Get-EsxCli -VMHost $serverhostname).software.acceptance.get()

However, I am getting the below error

Object of type 'InternalVimApi_50.ManagedObjectReference' cannot be converted to type 'System.String'.
At line:1 char:1
+ $AcceptLevel = (Get-EsxCli -VMHost $serverhostname).software.acceptan ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], ArgumentException
    + FullyQualifiedErrorId : System.ArgumentException

1 Answer 1

0

If you looking for acceptance level of a specific host then you can try the following commands

$AcceptLevel = Get-EsxCli -VMhost $myhost[0]

====================================================

$AcceptLevel.software.acceptance.get() - Same as the command you provided.

====================================================

PowerCLI C:> Connect-VIServer -Server hostname

Name Port User ---- ---- ----

XXXX

PowerCLI C:> Get-VMhost

Name ConnectionState PowerState ---- --------------- ----------

XXXX Connected PoweredOn 20

PowerCLI C:> $myhost = Get-VMHost

====================================================

PowerCLI C:> $myhost[0]

Name ConnectionState PowerState MemoryUsageGB
---- --------------- ---------- -------------
XXXX Connected PoweredOn 20

PowerCLI C:> $acceptance = Get-EsxCli -VMHost $myhost[0]

====================================================

PowerCLI C:> $acceptance.software.acceptance.get() PartnerSupported

====================================================

3
  • I am getting an error Get-EsxCli : 6/25/2018 3:07:02 PM Get-EsxCli VMHost parameter: Could not find any of the objects specified by name. At line:1 char:16 + $AcceptLevel = Get-EsxCli -VMhost $serverhostname[0] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (VMware.VimAutom...VMHost[] VMHost:RuntimePropertyInfo) [Get-EsxCli], ObnRecordProcessingFailedEx ception + FullyQualifiedErrorId : Core_ObnSelector_SetNewParameterValue_ObjectNotFoundCritical,VMware.VimAutomation.ViCore.Cmdlets.Commands.EsxCli. GetEsxCli
    – meallhour
    Jun 25, 2018 at 20:07
  • Probably something is missing. I have added the commands to my earlier answer.
    – rajeevrn
    Jun 26, 2018 at 6:12
  • just put $serverhostname in your instance, not [0] Jun 26, 2018 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.