Hi Mark,
I believe we might be over complicating this. You can use the command set below to get what you are looking for;
****************************************
#collect vcenter name, user, password. Delete the $esxuser and $esxpass if you want it to prompt for creds
$curvc = read-host "Enter VC Name"
$esxuser = read-host "Enter VC username"
$esxpass = read-host "Enter VC password"
#connects to vcenter. If you want the prompt for creds delete everything after the $curvc
connect-viserver -Server $curvc -User $esxuser -Password $esxpass
#gets list of VM's and selects the Name,NumCpu, MemoryMB,and VMhost properties
get-vm | select-object Name,NumCpu,MemoryMB,VMHost | export-csv C:\vm\vms.csv
#disconnects from anything that powershell is connected to
Disconnect-VIServer -Server $global:DefaultVIServers -Force -Confirm:$false
*********************************************
-Brad