Method invocation failed because [System.Object[]] does not contain a method named 'op_Division'

From my feeling I would say the content of $Arguments is not like you expect. I assume there are some blanks or an array is in there. I would check this first.

Please try:

$Arguments.GetType()
$Arguments[0]
$Arguments[1]
write-host ">$Arguments<"

What do you get back for these three lines?

 

I tried to use ‘C:’ as value for $Arguments and your code works.

Alternatively you could add a second step:

$tmpSize = $diskDetails.Size -as [double]
$SizeInGB = “{0:0}” -f ($tmpSize/1GB)
1 Like