Hi,
I am not able to overcome a snag:
I connect to vCenter and I want to loop the esxi hosts to get the LicenseKey for each one; but the format string in output is masking the serial like this: 88888-#####-#####-#####-88888
While, if I execute the same cmdlets but not in a loop, the format is correct and the serial is not masked, like this: 88888-88888-88888-88888-88888
Connect-VIServer -Server myvCenterServer .... connected
$esxi_hosts= Get-Vmhost
foreach ($host in $esxi_hosts)
{
$host.LicenseKey
}
How can I workaround this?
Many thanks
Luke
I'm not sure how you can use the $host variable, which is a reserved variable name.
How and from where are you running this?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Don't you get an error on the use of the $host variable?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Connect-VIServer -Server myvCenterServer .... connected
$esxi_hosts= Get-Vmhost
foreach ($esxi_host in $esxi_hosts)
{
$esxi_host.LicenseKey
}
This gave me the masked output like 88888-#####-#####-#####-88888
I thought I were missing something but I just discovered that I was using for the ViServer session a user with reduced permission. While I thought to be using the administrator@local user.
That is why
I apologize
The post can be closed or deleted
many thanks
Luke
No problem.
I prefer to leave the post up, that way someone else with the same issue knows where to look
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
