$getComputerName = read-host "Please enter the host name that you need to get information for" $strComputer = $getComputerName $c = get-credential $colItems = get-wmiobject -class "Win32_DiskDrive" -namespace "root\CIMV2" -computername $strComputer -credential c$ foreach ($objItem in $colItems) { write-host "Caption: " $objItem.Caption write-host "Media Type: " $objItem.MediaType write-host "Name: " $objItem.Name write-host "Partitions: " $objItem.Partitions write-host "PNP Device ID: " $objItem.PNPDeviceID write-host "Size: " $objItem.Size $GB = $objitem.Size / 1024 / 1024 / 1024 /1024 Write-host "Size in GB:" $GB write-host }