Hi All.
Having trouble finding the right term here. I am using WMI Win32_LogicalDisk to get the disk drive information.
I want to get the size and display it, but only the value on the left of the decimal point. Right now I am getting values like:
124.2135546876546864
I am using:
$strDiskItems = get-wmiobject -credential $Cred -class "Win32_LogicalDisk" -namespace "root\CIMV2" `
-computername $strComputer -filter "DriveType=3"
$Put = ""
foreach ($objitem in $strDiskItems) {
$Cap = $objItem.Caption
$Size = $objItem.Size/1024/1024/1024
$Free = $objItem.FreeSpace/1024/1024/1024
$Put = $Put + $Cap + $Free + "/" + $Size
$WS.Cells.Item($count,8) = $Put
}
Any way to do this? Some kind of built in truncate or math function?
Thanks!