Hello-
You can just add in a calculated property to have the current vCenter name included with the corresponding license info, like:
## array of names of vCenters to which to connect
$arrVCList="myvc0.mydom.com","myvc1.mydom.com"
&{foreach ($strVCin$arrVCList) {
## connect to this vCenter name
$oThisVC=Connect-VIServer-Server$strVC
## get this vC's license mgr
$viewLicMgr=Get-View$oThisVC.ExtensionData.Content.LicenseManager -PropertyLicenses
## select some things
$viewLicMgr.Licenses | select @{n="vCenterName"; e={$oThisVC.Name}},*
Disconnect-VIserver$oThisVC-Confirm:$false | Out-Null
}} | Export-CsvD:\Scripts\License\licenses.csv-NoTypeInformation-UseCulture
I changed it up a bit to keep things in the pipeline a bit more (vs. stuffing the license info into a variable). That get it?