You can use the vmstores drive. Like the next example. vito is the name of our vCenter server. 501 is the returned length.
Z:\vmware\scripts> (dir "vmstores:\vito@443\VMware Infrastructure Test Omgeving\vito_vmfs02\scompxx64\scompxx64.vmdk").length
501
Z:\vmware\scripts> get-datastore | % { $_.datastorebrowserpath}
vmstores:\vito@443\VMware Infrastructure Test Omgeving\vito_vmfs02
vmstores:\vito@443\VMware Infrastructure Test Omgeving\vito_vmfs01
vmstores:\vito@443\VMware Infrastructure Test Omgeving\vito_vmfs03
vmstores:\vito@443\VMware Infrastructure Test Omgeving\scomp0407_boot (1)
vmstores:\vito@443\VMware Infrastructure Test Omgeving\scomp0408_boot (1)
vmstores:\vito@443\VMware Infrastructure Test Omgeving\vito_vmfs04_nfs
Z:\vmware\scripts> dir "vmstores:\vito@443\VMware Infrastructure Test Omgeving\vito_vmfs02"
Datastore path:
LastWriteTime Type Length Name
-
-
-
-
22-9-2009 10:47 Folder RDPtest
11-3-2009 11:23 Folder vcomp000x
28-7-2009 14:05 Folder templ_w2k3x64R2_tst
28-7-2009 15:11 Folder proefkonijn
21-9-2009 14:49 Folder templ_w2k3x64R2
15-2-2010 11:38 Folder proefkonijn2
1-10-2009 12:24 Folder scompxx64
4-11-2009 13:45 Folder scomp0065tst