In this line
$HostInfo.licensed = ($msg[0] -split "State: ")[1]
you assign a value to the 'licensed' property of the object in the variable $HostInfo.
But that object in $HostInfo doesn't seem to be defined anywhere. That explains the error message.
You should add this line in your script
$HostInfo = {} | Select HostName,ESXVersion,Cluster,pNic,DriverName,DriverVersion,DriverFirmware,Licensed
That define the object and its properties, more specifically the Licensed property..