How about something like this.. Also if you want to run this as a schedule you might consider encrypting the credentials like this
Get-Credential –Credential “administrator@vsphere.local” | Export-Clixml C:\Scripts\mycreds.xml
$vc = 'vca.vsphere.local'
$folder = 'VM_folder'
$reportpath = 'c:\vm_report\vms.csv'
$Cred = Get-Credential
#$Cred = Import-Clixml C:\Scripts\mycreds.xml
Connect-VIServer $VC -Credential $Cred
$vms = Get-Folder $folder | Get-VM
$vms | Select-Object @{e={$_.name};L="VM Name"},
@{e={$_.NumCpu};L="Number of vCPU's"},
@{e={$_.MemoryGB};L="Allocated Memory GB"},
@{n="Total Disk Size GB"; e={(Get-HardDisk -VM $_ | Measure-Object -Sum CapacityGB).Sum}},
@{n="Total Disk Space Used GB"; e={[math]::round( $_.UsedSpaceGB )}}|
Export-Csv -Path $reportpath -NoTypeInformation
Disconnect-VIServer $vc -Force -Confirm:$false
Remove-Variable * -Force -ErrorAction SilentlyContinue