Hi there,
I successfully upgraded from PowerCLI 6.0 Release 1 to PowerCLI 6.0 Release 2.
After that, I wanted to add a new license to bulk license newly deployed ESXi Hosts with Auto Deploy but ran into the following error:
$licenseData = New-Object VMware.VimAutomation.License.Types.LicenseData
New-Object : Cannot find type [VMware.VimAutomation.License.Types.LicenseData]: verify that the assembly containing this type is loaded.
At line:1 char:16
+ $licenseData = New-Object VMware.VimAutomation.License.Types.LicenseData
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidType: (:) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand
I'm pretty sure this worked with PowerCLI 6.0 Release 1.
Did someone else run into it as well? Maybe any workarounds?
I appreciate your help.
cheers,
Ronny
Hello,
This is a backward compatibility issue that was introduced in PowerCLI 6.0R2. It is going to be addressed very soon in a forthcoming patch release, but until then you can workaround
replacing
"VMware.VimAutomation.License.Types.LicenseData"
with
"VMware.VimAutomation.License.Types.V1.LicenseData"
Have in mind that if you do the above in order to make your script work and later upgrade your PowerCLI to newer version you'll need to revert this change in the scripts.
-Dimitar Milov
I have the same problem with PowerCLI 6.0 Release 2.
Licensing was converted from a snap-in to a module in R2. Is the module loaded?
the module is loaded. Get-LicenseDataManager Cmdlet is working so far.
Anyone figure this out yet?
Hello,
This is a backward compatibility issue that was introduced in PowerCLI 6.0R2. It is going to be addressed very soon in a forthcoming patch release, but until then you can workaround
replacing
"VMware.VimAutomation.License.Types.LicenseData"
with
"VMware.VimAutomation.License.Types.V1.LicenseData"
Have in mind that if you do the above in order to make your script work and later upgrade your PowerCLI to newer version you'll need to revert this change in the scripts.
-Dimitar Milov
That worked perfectly. I was trying to find an updated version of the vSphere 6 documentation for Bulk Licensing that would include that very helpful information. Does that exist somewhere? If so, do you happen to have the link?
As Dimitar pointed out, this is a backward compatibility issue that we've already fixed and will be releasing very soon. Once the official fix is out, the proposed namespace change will no longer be needed (or work for that matter). For this very reason, updating the official documentation wouldn't make much sense either.
One thing to reiterate on is - if you use the workaround, please keep in mind that you'll need to revert it once you apply the patch (that restores the namespace for this type). Therefore this is really just a temporary workaround that we only recommend you use in case you can't afford waiting for another week or two until the fix is out.
We should have been more careful in this case and not have let this one slip. Sorry for the inconveniences this may have caused!
Cheers,
Alex
with the new release of PowerCLI 6.0 Release 3 this issue has been fixed.
thank you, Alex!