Since the script is using the Get-View cmdlet to retrieve the VMs, you receive the vSphere VirtualMachine object, not the .Net VirtualMachine object.
These are not the same objects ! And hence the Harddisks property is not available in the object you are receiving.
The attached script should provide you with the CapacityGB value for each harddisk.
The free space value has to be retrieved in a different way.