Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for($i = 0; $i -lt $drives.Count; $i++) {
- #get the drive letter
- $driveLetter = $drives.DriveLetter[$i]
- # calc some bytes
- $freeBytes = $drives.FreeSpace[$i]
- $totalBytes = $drives.Capacity[$i]
- $usedBytes = $totalBytes - $freeBytes
- # calc some gigs
- $usedGigs = gigify($usedBytes)
- $totalGigs = gigify($totalBytes)
- $freeGigs = gigify($freeBytes)
- if($totalGigs -gt 1) {
- $driveLetter + "\ USED: " + $usedGigs + "/" + $totalGigs + "Gb || " + "{0:N2}" -f (($usedBytes/$totalBytes)*100) + "%"
- }
- else {}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement