Something like this?
$dsName = 'MyDatastoreName'
$ds = Get-Datastore -Name $dsName
New-PSDrive -Name DS -Root \ -PSProvider VimDatastore -Datastore $ds | Out-Null
Get-ChildItem -Path DS:/ -recurse |
Select-Object Name,
@{N='Type';E={$_.ItemType}},
@{N='Path';E={$_.DatastoreFullPath}},
@{N='SizeKB';E={[math]::Round($_.Length/1KB,1)}}
Remove-PSDrive -Name DS -Confirm:$false