I am trying to get the size value of each physical hard drive in a machine. I am able to get the value of the first drive but can't seem to figure out how to code it to get the value of each drive if there is more than one present. Here is the code I'm using please help if you can. Thanks!

Code:

$Dsks = GetObject("winmgmts://$computername").ExecQuery("select * from Win32_DiskDrive")
if @error <> 0
? @error + " / " @serror ? ? shell "%comspec% /c pause"
else
for each $Item in $Dsks
$TotalDsks = $Item.Size
If $TotalDsks = ""
$TotalDsks = "NULL"
else
endif
next
endif