This will give you the list per vCenter, provided you are not running in multiple mode, with the full folderpath (which can be handy in case of duplciate names).
And it uses only 1 Get-VM call
Get-VM|Group-Object-Property {$_.Folder.Id} |
Select@{N="Folder";E={
$folder=$_.Group[0].Folder
$path=$folder.Name
while($folder.Parent){
$folder=$folder.Parent
$path=$folder.Name+"/"+$path
}
$path
}},
@{N="NumCPU";E={$_.Group|Measure-Object-PropertyNumCpu-Sum|Select-ExpandPropertySum}},
@{N="MemoryGB";E={$_.Group|Measure-Object-PropertyMemoryGB-Sum|Select-ExpandPropertySum}}