I am wondering if it possible to have a variable contain a different value based on a IF-ELSE statement:
IF (($tp.extensiondata.storage.perdatastoreusage.committed / 1073741824) -gt [int]$row.C_System)
$TotalDisk = (($tp.extensiondata.storage.perdatastoreusage.committed / 1073741824) + [int]$row.D_Drive + [int]$row.EDrive)
ELSE
$TotalDisk = ($row.C_System + $row.D_Drive + $row.EDrive)
The IF statement results in a proper calculation but when that condition is not met and it proceeds to the ELSE statement, I get "40.0003093760461" as a sum of those numbers. I have tried using the above example as well as:
ELSE
$TotalDisk = ($row.C_System + $row.D_Drive + $row.EDrive)
Both resulted in the same number (40.0003093760461) - is there something else I need to add to the calculation to make it go through successfully?