|$MyVC = $DefaultVIServer|
|$LicenseManager = get-view ($MyVC.ExtensionData.content.LicenseManager)|
|$LicenseAssignmentManager = get-view ($LicenseManager.licenseAssignmentManager)|
check out Brian's post too:
Looking at your code, it seems to update the licence applied to the vCenter with a new one. My question was how to modify the "License" field highlighted yellow in the screen shot.
This does not seem to be availble anywhere in the API that I can find.