PowerShell $ + $

Solution 1:

you are trying to add two PSCustomObject items to each other ... and that object type does not have an addition method. [grin]

what you want to add is the value in the single property of each object. this ...

$FDS.Free + $UDS.Used

... will give you what you want.

however, i would use something like ...

$CDriveInfo = Get-PSDrive -Name 'c'
$TotalSize_CDrive = $CDriveInfo.Free + $CDriveInfo.Used

$TotalSize_CDrive

... OR use Get-Volume OR a CIM query since those have the drive capacity directly available.